mirror of https://github.com/rusefi/rusefi-1.git
auto-sync
This commit is contained in:
parent
f71b639bbf
commit
62844ab261
|
@ -85,8 +85,8 @@ board_configuration_s *boardConfiguration = &persistentState.persistentConfigura
|
||||||
* CH_FREQUENCY is the number of system ticks in a second
|
* CH_FREQUENCY is the number of system ticks in a second
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VirtualTimer periodicSlowTimer;
|
static virtual_timer_t periodicSlowTimer;
|
||||||
static VirtualTimer periodicFastTimer;
|
static virtual_timer_t periodicFastTimer;
|
||||||
|
|
||||||
static LoggingWithStorage logger("Engine Controller");
|
static LoggingWithStorage logger("Engine Controller");
|
||||||
|
|
||||||
|
|
|
@ -117,8 +117,8 @@ extern virtual_timers_list_t vtlist;
|
||||||
extern bool main_loop_started;
|
extern bool main_loop_started;
|
||||||
|
|
||||||
int getVtSizeEstimate(void) {
|
int getVtSizeEstimate(void) {
|
||||||
VirtualTimer *first = vtlist.vt_next;
|
virtual_timer_t *first = vtlist.vt_next;
|
||||||
VirtualTimer *cur = first->vt_next;
|
virtual_timer_t *cur = first->vt_next;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
while (c++ < 20 && cur != first) {
|
while (c++ < 20 && cur != first) {
|
||||||
cur = cur->vt_next;
|
cur = cur->vt_next;
|
||||||
|
|
|
@ -79,9 +79,9 @@ static void setInjectorEnabled(int id, int value) {
|
||||||
|
|
||||||
static void runBench(brain_pin_e brainPin, OutputPin *output, float delayMs, float onTimeMs, float offTimeMs,
|
static void runBench(brain_pin_e brainPin, OutputPin *output, float delayMs, float onTimeMs, float offTimeMs,
|
||||||
int count) {
|
int count) {
|
||||||
int delaySt = (int) (delayMs * CH_FREQUENCY / 1000);
|
int delaySt = MS2ST(delayMs);
|
||||||
int onTimeSt = (int) (onTimeMs * CH_FREQUENCY / 1000);
|
int onTimeSt = MS2ST(onTimeMs);
|
||||||
int offTimeSt = (int) (offTimeMs * CH_FREQUENCY / 1000);
|
int offTimeSt = MS2ST(offTimeMs);
|
||||||
if (delaySt < 0) {
|
if (delaySt < 0) {
|
||||||
scheduleMsg(&logger, "Invalid delay %f", delayMs);
|
scheduleMsg(&logger, "Invalid delay %f", delayMs);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -60,6 +60,10 @@ typedef Thread thread_t;
|
||||||
typedef EventListener event_listener_t;
|
typedef EventListener event_listener_t;
|
||||||
typedef EventSource event_source_t;
|
typedef EventSource event_source_t;
|
||||||
typedef VTList virtual_timers_list_t;
|
typedef VTList virtual_timers_list_t;
|
||||||
|
typedef VirtualTimer virtual_timer_t;
|
||||||
|
|
||||||
|
#define HAL_SUCCESS CH_SUCCESS
|
||||||
|
#define HAL_FAILED CH_FAILED
|
||||||
|
|
||||||
#define THD_WORKING_AREA WORKING_AREA
|
#define THD_WORKING_AREA WORKING_AREA
|
||||||
#define THD_FUNCTION(tname, arg) void tname(void *arg)
|
#define THD_FUNCTION(tname, arg) void tname(void *arg)
|
||||||
|
|
|
@ -53,7 +53,7 @@ flashsector_t flashSectorAt(flashaddr_t address) {
|
||||||
static bool flashUnlock(void) {
|
static bool flashUnlock(void) {
|
||||||
/* Check if unlock is really needed */
|
/* Check if unlock is really needed */
|
||||||
if (!(FLASH->CR & FLASH_CR_LOCK))
|
if (!(FLASH->CR & FLASH_CR_LOCK))
|
||||||
return CH_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
|
|
||||||
/* Write magic unlock sequence */
|
/* Write magic unlock sequence */
|
||||||
FLASH->KEYR = 0x45670123;
|
FLASH->KEYR = 0x45670123;
|
||||||
|
@ -61,8 +61,8 @@ static bool flashUnlock(void) {
|
||||||
|
|
||||||
/* Check if unlock was successful */
|
/* Check if unlock was successful */
|
||||||
if (FLASH->CR & FLASH_CR_LOCK)
|
if (FLASH->CR & FLASH_CR_LOCK)
|
||||||
return CH_FAILED;
|
return HAL_FAILED;
|
||||||
return CH_SUCCESS;
|
return HAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
/* Error codes */
|
/* Error codes */
|
||||||
|
|
||||||
/** @brief Flash operation successful */
|
/** @brief Flash operation successful */
|
||||||
#define FLASH_RETURN_SUCCESS CH_SUCCESS
|
#define FLASH_RETURN_SUCCESS HAL_SUCCESS
|
||||||
|
|
||||||
/** @brief Flash operation error because of denied access, corrupted memory.*/
|
/** @brief Flash operation error because of denied access, corrupted memory.*/
|
||||||
#define FLASH_RETURN_NO_PERMISSION -1
|
#define FLASH_RETURN_NO_PERMISSION -1
|
||||||
|
|
Loading…
Reference in New Issue