forked from IQ.Lvbs/IQ.Pilot
Tesla - Wake on CAN
This commit is contained in:
@@ -193,7 +193,8 @@ static void tick_handler(void) {
|
||||
|
||||
// tick drivers at 1Hz
|
||||
bool started = harness_check_ignition() || ignition_can;
|
||||
bootkick_tick(started, recent_heartbeat);
|
||||
bool wake_up = started || wake_on_can;
|
||||
bootkick_tick(wake_up, recent_heartbeat);
|
||||
|
||||
// increase heartbeat counter and cap it at the uint32 limit
|
||||
if (heartbeat_counter < UINT32_MAX) {
|
||||
@@ -273,11 +274,16 @@ static void tick_handler(void) {
|
||||
if (ignition_can_cnt > 2U) {
|
||||
ignition_can = false;
|
||||
}
|
||||
// Set wake on can after 2s of no CAN seen
|
||||
if (wake_on_can_cnt > 2U) {
|
||||
wake_on_can = false;
|
||||
}
|
||||
|
||||
// on to the next one
|
||||
uptime_cnt += 1U;
|
||||
safety_mode_cnt += 1U;
|
||||
ignition_can_cnt += 1U;
|
||||
wake_on_can_cnt += 1U;
|
||||
|
||||
// synchronous safety check
|
||||
safety_tick(¤t_safety_config);
|
||||
|
||||
Reference in New Issue
Block a user