Skip to content

Commit e3a8d86

Browse files
authored
add in watchdog and flashing LED during init (#5)
1 parent d5ef5b5 commit e3a8d86

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/dronecan.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ void DroneCAN::init(CanardOnTransferReception onTransferReceived,
1313

1414
strncpy(this->node_name, name, sizeof(this->node_name));
1515

16+
IWatchdog.reload();
17+
1618
canardInit(&canard,
1719
memory_pool,
1820
sizeof(memory_pool),
@@ -32,6 +34,8 @@ void DroneCAN::init(CanardOnTransferReception onTransferReceived,
3234
// initialise the internal LED
3335
pinMode(19, OUTPUT);
3436

37+
IWatchdog.reload();
38+
3539
// put our user params into memory
3640
this->set_parameters(param_list);
3741

@@ -42,6 +46,9 @@ void DroneCAN::init(CanardOnTransferReception onTransferReceived,
4246
{
4347
this->cycle();
4448
IWatchdog.reload();
49+
delay(20);
50+
digitalWrite(19, this->led_state);
51+
this->led_state = !this->led_state;
4552
}
4653
}
4754

0 commit comments

Comments
 (0)