F7 progress :)

This commit is contained in:
rusefi 2019-02-06 18:41:48 -05:00
parent e12c315461
commit 45fa6089a4
2 changed files with 10 additions and 5 deletions

View File

@ -29,7 +29,7 @@
#define CHCONF_H #define CHCONF_H
// todo: access some existing configuration field // todo: access some existing configuration field
#define CORE_CLOCK 168000000 #define CORE_CLOCK 216000000
#define _CHIBIOS_RT_CONF_ #define _CHIBIOS_RT_CONF_
#define _CHIBIOS_RT_CONF_VER_5_1_ #define _CHIBIOS_RT_CONF_VER_5_1_
@ -79,7 +79,7 @@ extern "C"
* setting also defines the system tick time unit. * setting also defines the system tick time unit.
*/ */
#if !defined(CH_CFG_ST_FREQUENCY) #if !defined(CH_CFG_ST_FREQUENCY)
#define CH_CFG_ST_FREQUENCY 10000 #define CH_CFG_ST_FREQUENCY 1000
#endif #endif
/** /**
@ -106,8 +106,13 @@ extern "C"
* The value one is not valid, timeouts are rounded up to * The value one is not valid, timeouts are rounded up to
* this value. * this value.
*/ */
// rusEfi currently uses tick mode, see CH_CFG_ST_FREQUENCY
// ST requires TIM2 or another 32 bit timer and we currently use it for ICU
// but! there is no reason to use it for ICU as we've recently realized
// so todo: migrate trigger to EXTI and try tick-less mode
// see also CH_CFG_TIME_QUANTUM
#if !defined(CH_CFG_ST_TIMEDELTA) #if !defined(CH_CFG_ST_TIMEDELTA)
#define CH_CFG_ST_TIMEDELTA 2 #define CH_CFG_ST_TIMEDELTA 0
#endif #endif
/** @} */ /** @} */

View File

@ -211,7 +211,7 @@ void turnOnCapturePin(const char *msg, brain_pin_e brainPin) {
digital_input_s * addWaveAnalyzerDriver(const char *msg, brain_pin_e brainPin) { digital_input_s * addWaveAnalyzerDriver(const char *msg, brain_pin_e brainPin) {
ICUDriver *driver = getInputCaptureDriver(msg, brainPin); ICUDriver *driver = getInputCaptureDriver(msg, brainPin);
if (driver == NULL) { if (driver == NULL) {
warning(CUSTOM_ERR_INVALID_INPUT_ICU_PIN, "not input pin"); warning(CUSTOM_ERR_INVALID_INPUT_ICU_PIN, "w_not input pin");
return NULL; return NULL;
} }
@ -256,7 +256,7 @@ void removeWaveAnalyzerDriver(const char *msg, brain_pin_e brainPin) {
void startInputDriver(/*nullable*/digital_input_s *hw, bool isActiveHigh) { void startInputDriver(/*nullable*/digital_input_s *hw, bool isActiveHigh) {
if (hw == NULL) { if (hw == NULL) {
// we can get NULL driver if user somehow has invalid pin in his configuration // we can get NULL driver if user somehow has invalid pin in his configuration
warning(CUSTOM_ERR_INVALID_INPUT_ICU_PIN, "not input pin"); warning(CUSTOM_ERR_INVALID_INPUT_ICU_PIN, "s_not input pin");
return; return;
} }