Skip to content
This repository was archived by the owner on Aug 4, 2023. It is now read-only.

Commit aec1a46

Browse files
committed
final provisioning: ign on for 3s, off for 2s
1 parent 7b7197c commit aec1a46

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

board/main.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ void __attribute__ ((noinline)) enable_fpu(void) {
229229
void TIM3_IRQHandler(void) {
230230
static uint32_t tcnt = 0;
231231
static uint32_t button_press_cnt = 0;
232-
static bool prev_button_status = false;
233232

234233
if (TIM3->SR != 0) {
235234
can_live = pending_can_live;
@@ -263,12 +262,21 @@ void TIM3_IRQHandler(void) {
263262
board_set_panda_power(!panda_power);
264263
}
265264

265+
#ifdef FINAL_PROVISIONING
266+
// ign on for 3s, off for 2s
267+
const bool ign = ((tcnt/10) % (3+2)) < 3;
268+
if (ign != ignition) {
269+
board_set_ignition(ign);
270+
}
271+
#else
272+
static bool prev_button_status = false;
266273
if (!current_button_status && prev_button_status && button_press_cnt < 10){
267274
board_set_ignition(!ignition);
268275
}
276+
prev_button_status = current_button_status;
277+
#endif
269278

270279
button_press_cnt = current_button_status ? button_press_cnt + 1 : 0;
271-
prev_button_status = current_button_status;
272280

273281
// on to the next one
274282
tcnt += 1U;

0 commit comments

Comments
 (0)