Skip to content

Commit 588a069

Browse files
committed
Merge branch 'master' of ssh://github.com/tinkerspy/Automaton
2 parents ce52cc4 + a594dc8 commit 588a069

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

src/Atm_led.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ Atm_led& Atm_led::begin( int attached_pin, bool activeLow ) {
44
// clang-format off
55
static const state_t state_table[] PROGMEM = {
66
/* ON_ENTER ON_LOOP ON_EXIT EVT_ON_TIMER EVT_OFF_TIMER EVT_COUNTER EVT_ON EVT_OFF EVT_BLINK EVT_TOGGLE EVT_TOGGLE_BLINK ELSE */
7-
/* IDLE */ ENT_INIT, ATM_SLEEP, -1, -1, -1, -1, ON, -1, START, ON, START, -1, // LED off
8-
/* ON */ ENT_ON, ATM_SLEEP, -1, -1, -1, -1, -1, OFF, START, OFF, OFF, -1, // LED on
9-
/* START */ ENT_ON, -1, -1, BLINK_OFF, -1, DONE, ON, OFF, -1, OFF, OFF, -1, // Start blinking
10-
/* BLINK_OFF */ ENT_OFF, -1, -1, -1, START, DONE, ON, OFF, -1, OFF, OFF, -1,
11-
/* DONE */ -1, -1, EXT_CHAIN, -1, OFF, -1, ON, OFF, START, OFF, OFF, -1, // Wait after last blink
12-
/* OFF */ ENT_OFF, -1, -1, -1, -1, -1, ON, OFF, START, -1, -1, IDLE, // All off -> IDLE
7+
/* IDLE */ ENT_INIT, ATM_SLEEP, -1, -1, -1, -1, ON, -1, START, ON, START, -1, // LED off
8+
/* ON */ ENT_ON, ATM_SLEEP, -1, -1, -1, -1, -1, OFF, START, OFF, OFF, -1, // LED on
9+
/* START */ ENT_ON, -1, -1, BLINK_OFF, -1, -1, ON, OFF, -1, OFF, OFF, -1, // Start blinking
10+
/* BLINK_OFF */ ENT_OFF, -1, -1, -1, LOOP, -1, ON, OFF, -1, OFF, OFF, -1,
11+
/* LOOP */ -1, -1, -1, -1, -1, DONE, ON, OFF, -1, OFF, OFF, START,
12+
/* DONE */ -1, -1, EXT_CHAIN, -1, OFF, -1, ON, OFF, START, OFF, OFF, -1, // Wait after last blink
13+
/* OFF */ ENT_OFF, -1, -1, -1, -1, -1, ON, OFF, START, -1, -1, IDLE, // All off -> IDLE
1314
};
1415
// clang-format on
1516
Machine::begin( state_table, ELSE );
@@ -145,6 +146,6 @@ Atm_led& Atm_led::trace( Stream& stream ) {
145146
setTrace( &stream, atm_serial_debug::trace,
146147
"LED\0EVT_ON_TIMER\0EVT_OFF_TIMER\0EVT_COUNTER\0EVT_ON\0EVT_OFF\0EVT_"
147148
"BLINK\0EVT_TOGGLE\0EVT_TOGGLE_BLINK\0ELSE\0"
148-
"IDLE\0ON\0START\0BLINK_OFF\0DONE\0OFF" );
149+
"IDLE\0ON\0START\0BLINK_OFF\0LOOP\0DONE\0OFF" );
149150
return *this;
150151
}

src/Atm_led.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class Atm_led : public Machine {
66
public:
7-
enum { IDLE, ON, START, BLINK_OFF, DONE, OFF };
7+
enum { IDLE, ON, START, BLINK_OFF, LOOP, DONE, OFF };
88
enum { EVT_ON_TIMER, EVT_OFF_TIMER, EVT_COUNTER, EVT_ON, EVT_OFF, EVT_BLINK, EVT_TOGGLE, EVT_TOGGLE_BLINK, ELSE };
99
enum { EVT_START = EVT_BLINK };
1010

src/Atm_timer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Atm_timer& Atm_timer::interval( uint32_t v ) {
9696
return interval_millis( v );
9797
}
9898

99-
Atm_timer& Atm_timer::repeat( uint16_t v ) {
99+
Atm_timer& Atm_timer::repeat( uint16_t v /* = ATM_COUNTER_OFF */ ) {
100100
repeat_cnt = v;
101101
repcounter.set( v );
102102
return *this;

src/Atm_timer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Atm_timer : public Machine {
1818
Atm_timer& interval_millis( uint32_t v );
1919
Atm_timer& interval( uint32_t v );
2020
uint32_t left();
21-
Atm_timer& repeat( uint16_t v );
21+
Atm_timer& repeat( uint16_t v = ATM_COUNTER_OFF );
2222
Atm_timer& start( void );
2323
Atm_timer& stop( void );
2424

0 commit comments

Comments
 (0)