Skip to content

Commit aa2f4b6

Browse files
committed
AVR example fix static declaration guard
1 parent 7439e49 commit aa2f4b6

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

  • examples/avr/basic_usage_callbacks/src

examples/avr/basic_usage_callbacks/src/main.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@
6060

6161
/*****************************************************************************/
6262

63+
/* Global Elements */
64+
65+
// UART Object
66+
AvrUart Serial(UART0, F_CPU);
67+
68+
// Command Line Interface Object
69+
MINBASECLI Cli;
70+
71+
/*****************************************************************************/
72+
6373
/* Function Prototypes */
6474

6575
// Initialize the LED (GPIO)
@@ -86,17 +96,14 @@ void cmd_version(MINBASECLI* Cli, int argc, char* argv[]);
8696

8797
int main(void)
8898
{
89-
static AvrUart Serial(UART0, F_CPU);
90-
static MINBASECLI Cli;
91-
9299
// Set LED Pin as digital Output
93100
led_init();
94101

95102
// Initilize UART0
96103
Serial.setup(SERIAL_BAUDS);
97104

98105
// CLI init to use Serial as interface
99-
Cli.setup(&Serial);
106+
Cli.setup(&Serial, SERIAL_BAUDS);
100107

101108
// Add commands and bind callbacks to them
102109
Cli.add_cmd("led", &cmd_led, PSTR("led [on/off], Turn LED ON or OFF.."));

0 commit comments

Comments
 (0)