FreeEMS
0.2.0-SNAPSHOT-282-g9efc524
|
TODO figure out what the correct "temperature" is to make MAF work correctly!
accumulate errors such that we know what sort of PW WOULD have been requested and enable a "over duty cut" to protect boosted users with insufficient injector size on cold nights
FIXME part of to schedule or not to schedule should be : (masterPulseWidth > injectorMinimumPulseWidth)
TODO figure out what the correct "temperature" is to make MAF work correctly!
accumulate errors such that we know what sort of PW WOULD have been requested and enable a "over duty cut" to protect boosted users with insufficient injector size on cold nights
FIXME part of to schedule or not to schedule should be : (masterPulseWidth > injectorMinimumPulseWidth)
Introduce the concept of sync level to schedule for if NOT synced
and a way of deciding what to do in different sync states
and proper dividers for pulsewidths
and ability to lock pulsewidht/dwell for scheduling
and generalise scheduling to all pins
and provide a way of choosing a source of pulsewidth dwell or fuel duration
and a way of allowing overly advanced scheduling instead of none, when its fuel
TODO function to setup a packet and send it fn(populateBodyFunctionPointer(), header, other, fields, here, and, use, or, not, within){}
TODO factor many things into functions and move the receive delegator to its own file
factor this out into validation delegation function once the number of types increases somewhat
factor this out into validation delegation function once the number of types increases somewhat
test all things listed below:
factor this out into validation delegation function once the number of types increases somewhat
factor this out into validation delegation function once the number of types increases somewhat
test all things listed below:
TODO Move these to decoder interface, and make set by each decoder where appropriate
TODO Move these to decoder interface AND rename to be more generic/meaningful/accurate, and make set by each decoder where appropriate
TODO For Sean to integrate back in
TODO we should define the register masks that we use in one place, but probably not in the main device header.
TODO maybe move this to paged flash ?
TODO Add verification reporting code here that disables the timer interrupts such that no events ever get scheduled, and then sits looping sending error packets out about what is wrong. set a whole bunch of flags and check them here sending a packet for each with a unique errorID for each and thus a unique easy to understand message for each on the PC side. BEFORE the priming code such that no fuel gets injected. Will need to modularise the comms stuff to process packets based on calls from this section too, avoid excess duplication if possible.
TODO two unsigned chars, and two unsigned shorts, which is the MAP ADC value, the MAP value is sampled on every event in a cycle, and if less than the previous stored value, which is reset at every zeroth event, with the old value and old event number stored globally.
TODO the same thing could be done, but with a median filter or similar, perhaps map sampling could be done dymanically like this, though it could yield unpredictable results, it could also yield the best running engines, just a thought...
TODO this is pulling in the system string.h not the m68hc1x version, and functions other than memcpy do not work because they are not in crt1.o or other included-by-default libs
TODO setup proper sequence and clock with some sort of differential measurement log to log. insert in front of actual data because these are part of the log itself.
TODO this is pulling in the system string.h not the m68hc1x version, and functions other than memcpy do not work because they are not in crt1.o or other included-by-default libs
TODO setup proper sequence and clock with some sort of differential measurement log to log. insert in front of actual data because these are part of the log itself.
TODO this is in the wrong file!! Either move the header declaration or move the function!
TODO CAN0CTL1 &= CANCTL1_RX_DISABLE;
TODO CAN0CTL1 &= CANCTL1_RX_ISR_DISABLE;
TODO CAN0CTL1 |= CANCTL1_RX_ENABLE;
TODO CAN0CTL1 |= CANCTL1_RX_ISR_ENABLE;
TODO this is in the wrong file!! Either move the header declaration or move the function!
TODO CAN0CTL1 &= CANCTL1_RX_DISABLE;
TODO CAN0CTL1 &= CANCTL1_RX_ISR_DISABLE;
TODO CAN0CTL1 |= CANCTL1_RX_ENABLE;
TODO CAN0CTL1 |= CANCTL1_RX_ISR_ENABLE;
TODO refactor this entire file, especially to remove apparently expensive modulus operations which could be replaced with >= instead. Maybe much more.
TODO This is too quick to turn off, average 0.5 seconds, which is OK, but fastest = 0seconds which is difficult to understand, needs a flag and to be 1 - 2 with average 1.5.
TODO refactor this entire file, especially to remove apparently expensive modulus operations which could be replaced with >= instead. Maybe much more.
TODO This is too quick to turn off, average 0.5 seconds, which is OK, but fastest = 0seconds which is difficult to understand, needs a flag and to be 1 - 2 with average 1.5.
FIXME part of to schedule or not to schedule should be : (masterPulseWidth > injectorMinimumPulseWidth)
don't bother doing anything, settings don't make sense... TODO move this to init time to prevent bad config
don't bother doing anything, settings don't make sense... TODO move this to init time to prevent bad config
TODO create this check:
TODO Schedule injection with real timing, requires some tweaks to work right.
TODO move this loop variable to fixedConfig and make a subset of the remainder of channels configured for fuel with a start time/tooth directly set for now, ie, make the 6 channels usable as fuel or ignition from reasonable configuration and write a guide on how to set it up for any engine.
TODO move sched code to a function or functions (inline?) that can be unit tested such that we KNOW it performs as anticipated rather than just trying it out on a 400hp turbo truck engine.
TODO refactor this partly into init.c as per more detailed TD above
TODO keep an eye on overflow here when increasing resolution by scaling angles
TODO, do this ^ at init time from fixed config as an array of angles and a single engine offset combined into this runtime array.
TODO rather than look for the nearest tooth and then step through till you find the right one that can work, instead figure out the dwell in angle and subtract that too, and find the correct tooth first time, will save cpu cycles, and get same answer and be less complex...
FIXME part of to schedule or not to schedule should be : (masterPulseWidth > injectorMinimumPulseWidth)
don't bother doing anything, settings don't make sense... TODO move this to init time to prevent bad config
don't bother doing anything, settings don't make sense... TODO move this to init time to prevent bad config
TODO create this check:
TODO Schedule injection with real timing, requires some tweaks to work right.
TODO move this loop variable to fixedConfig and make a subset of the remainder of channels configured for fuel with a start time/tooth directly set for now, ie, make the 6 channels usable as fuel or ignition from reasonable configuration and write a guide on how to set it up for any engine.
TODO move sched code to a function or functions (inline?) that can be unit tested such that we KNOW it performs as anticipated rather than just trying it out on a 400hp turbo truck engine.
TODO refactor this partly into init.c as per more detailed TD above
TODO keep an eye on overflow here when increasing resolution by scaling angles
TODO, do this ^ at init time from fixed config as an array of angles and a single engine offset combined into this runtime array.
TODO rather than look for the nearest tooth and then step through till you find the right one that can work, instead figure out the dwell in angle and subtract that too, and find the correct tooth first time, will save cpu cycles, and get same answer and be less complex...
TODO Move this code into an include file much like the fuel interrupts such that it can be used for multiple UART SCI devices without duplication.
TODO Fix the init code such that this doesn't run at boot without a serail device attached. Clear buffer maybe? or flag clearing/isr enabling ordering?
TODO Move this code into an include file much like the fuel interrupts such that it can be used for multiple UART SCI devices without duplication.
TODO Fix the init code such that this doesn't run at boot without a serail device attached. Clear buffer maybe? or flag clearing/isr enabling ordering?
TODO why is this here, and why is it static/shared, investigate
TODO why is this here, and why is it static/shared, investigate
TODO Split this into its own file, create one for each, and clear flags for all, and increment shared counter as is.
TODO Currently not a problem, but as indirectly pointed out by johntramp, if no flag clearing is being done, then this code will run continuously, which is not a good idea...
TODO Split this into its own file, create one for each, and clear flags for all, and increment shared counter as is.
TODO Currently not a problem, but as indirectly pointed out by johntramp, if no flag clearing is being done, then this code will run continuously, which is not a good idea...