File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ ISR(PORTD_PORT_vect) {
9191 }
9292}
9393
94+ ISR (PORTF_PORT_vect) {
95+ if (PORTF.INTFLAGS & PIN6_bm) {
96+ asm (" jmp 0" );
97+ PORTF.INTFLAGS = PIN6_bm;
98+ }
99+ }
100+
94101void connectedToNetwork (void ) { event_flags |= NETWORK_CONN_FLAG; }
95102void disconnectedFromNetwork (void ) { event_flags |= NETWORK_DISCONN_FLAG; }
96103void connectedToBroker (void ) { event_flags |= BROKER_CONN_FLAG; }
@@ -261,6 +268,8 @@ void handleSerialCommand(const char *instruction, uint16_t instructionLen) {
261268 }
262269 } else if (strcmp (cmd, " heartbeat" ) == 0 ) {
263270 event_flags |= SEND_HEARTBEAT_FLAG;
271+ } else if (strcmp (cmd, " reset" ) == 0 ) {
272+ asm (" jmp 0" );
264273 } else {
265274 Log.info (" \n Invalid command" );
266275 printHelp ();
@@ -277,6 +286,11 @@ void setup() {
277286 // Set PD2 as input (button)
278287 pinConfigure (PIN_PD2, PIN_DIR_INPUT | PIN_INT_FALL);
279288
289+ // Set PF6 as input (reset button)
290+ pinConfigure (PIN_PF6, PIN_DIR_INPUT | PIN_INT_FALL);
291+
292+ sei ();
293+
280294 Log.infof (" Starting sandbox / landing page procedure. Version = %s\r\n " ,
281295 SANDBOX_VERSION);
282296
You can’t perform that action at this time.
0 commit comments