-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
templates: semihosting argv[1] loops
- Loading branch information
Showing
31 changed files
with
281 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-200-none-loop-blinky.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
timer_start(); | ||
|
||
blink_led_init(); | ||
|
||
uint32_t seconds = 0; | ||
|
||
// Infinite loop | ||
while (1) | ||
{ | ||
blink_led_on(); | ||
timer_sleep(BLINK_ON_TICKS); | ||
|
||
blink_led_off(); | ||
timer_sleep(BLINK_OFF_TICKS); | ||
|
||
++seconds; |
21 changes: 21 additions & 0 deletions
21
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-200-none-loop-blinky.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
Timer timer; | ||
timer.start(); | ||
|
||
BlinkLed blinkLed; | ||
|
||
// Perform all necessary initialisations for the LED. | ||
blinkLed.powerUp(); | ||
|
||
uint32_t seconds = 0; | ||
|
||
// Infinite loop | ||
while (1) | ||
{ | ||
blinkLed.turnOn(); | ||
timer.sleep(BLINK_ON_TICKS); | ||
|
||
blinkLed.turnOff(); | ||
timer.sleep(BLINK_OFF_TICKS); | ||
|
||
++seconds; |
6 changes: 6 additions & 0 deletions
6
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-200-none-loop-empty.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
// Infinite loop | ||
while (1) | ||
{ | ||
// Add your code here. | ||
} |
17 changes: 17 additions & 0 deletions
17
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-200-retarget-loop-blinky.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
timer_start(); | ||
|
||
blink_led_init(); | ||
|
||
uint32_t seconds = 0; | ||
|
||
// Infinite loop | ||
while (1) | ||
{ | ||
blink_led_on(); | ||
timer_sleep(BLINK_ON_TICKS); | ||
|
||
blink_led_off(); | ||
timer_sleep(BLINK_OFF_TICKS); | ||
|
||
++seconds; |
21 changes: 21 additions & 0 deletions
21
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-200-retarget-loop-blinky.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
Timer timer; | ||
timer.start(); | ||
|
||
BlinkLed blinkLed; | ||
|
||
// Perform all necessary initialisations for the LED. | ||
blinkLed.powerUp(); | ||
|
||
uint32_t seconds = 0; | ||
|
||
// Infinite loop | ||
while (1) | ||
{ | ||
blinkLed.turnOn(); | ||
timer.sleep(BLINK_ON_TICKS); | ||
|
||
blinkLed.turnOff(); | ||
timer.sleep(BLINK_OFF_TICKS); | ||
|
||
++seconds; |
6 changes: 6 additions & 0 deletions
6
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-200-retarget-loop-empty.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
// Infinite loop | ||
while (1) | ||
{ | ||
// Add your code here. | ||
} |
26 changes: 26 additions & 0 deletions
26
...gnuarmeclipse.templates.core/templates/common/src/main/main-200-semihosting-loop-blinky.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
timer_start(); | ||
|
||
blink_led_init(); | ||
|
||
uint32_t seconds = 0; | ||
|
||
#define LOOP_COUNT (5) | ||
int loops = LOOP_COUNT; | ||
if (argc > 1) | ||
{ | ||
// If defined, get the number of loops from the command line, | ||
// configurable via semihosting. | ||
loops = atoi (argv[1]); | ||
} | ||
|
||
// Short loop. | ||
for (int i = 0; i < loops; i++) | ||
{ | ||
blink_led_on(); | ||
timer_sleep(BLINK_ON_TICKS); | ||
|
||
blink_led_off(); | ||
timer_sleep(BLINK_OFF_TICKS); | ||
|
||
++seconds; |
30 changes: 30 additions & 0 deletions
30
...uarmeclipse.templates.core/templates/common/src/main/main-200-semihosting-loop-blinky.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
Timer timer; | ||
timer.start(); | ||
|
||
BlinkLed blinkLed; | ||
|
||
// Perform all necessary initialisations for the LED. | ||
blinkLed.powerUp(); | ||
|
||
uint32_t seconds = 0; | ||
|
||
#define LOOP_COUNT (5) | ||
int loops = LOOP_COUNT; | ||
if (argc > 1) | ||
{ | ||
// If defined, get the number of loops from the command line, | ||
// configurable via semihosting. | ||
loops = atoi (argv[1]); | ||
} | ||
|
||
// Short loop. | ||
for (int i = 0; i < loops; i++) | ||
{ | ||
blinkLed.turnOn(); | ||
timer.sleep(BLINK_ON_TICKS); | ||
|
||
blinkLed.turnOff(); | ||
timer.sleep(BLINK_OFF_TICKS); | ||
|
||
++seconds; |
15 changes: 15 additions & 0 deletions
15
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-200-semihosting-loop-empty.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
#define LOOP_COUNT (5) | ||
int loops = LOOP_COUNT; | ||
if (argc > 1) | ||
{ | ||
// If defined, get the number of loops from the command line, | ||
// configurable via semihosting. | ||
loops = atoi (argv[1]); | ||
} | ||
|
||
// Short loop. | ||
for (int i = 0; i < loops; i++) | ||
{ | ||
// Add your code here. | ||
} |
2 changes: 2 additions & 0 deletions
2
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-220-none-loopend.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
} | ||
// Infinite loop, never return. |
2 changes: 2 additions & 0 deletions
2
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-220-retarget-loopend.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
} | ||
// Infinite loop, never return. |
1 change: 1 addition & 0 deletions
1
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-220-semihosting-loopend.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
} |
5 changes: 5 additions & 0 deletions
5
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-230-none-end.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
} | ||
|
||
#pragma GCC diagnostic pop | ||
|
||
// ---------------------------------------------------------------------------- |
5 changes: 5 additions & 0 deletions
5
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-230-retarget-end.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
} | ||
|
||
#pragma GCC diagnostic pop | ||
|
||
// ---------------------------------------------------------------------------- |
6 changes: 6 additions & 0 deletions
6
ilg.gnuarmeclipse.templates.core/templates/common/src/main/main-230-semihosting-end.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
return 0; | ||
} | ||
|
||
#pragma GCC diagnostic pop | ||
|
||
// ---------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
ilg.gnuarmeclipse.templates.cortexm/templates/cortexm_project/src/main-30-none.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
int seconds = 0; | ||
|
||
// Infinite loop | ||
while (1) | ||
{ |
6 changes: 6 additions & 0 deletions
6
ilg.gnuarmeclipse.templates.cortexm/templates/cortexm_project/src/main-30-retarget.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
int seconds = 0; | ||
|
||
// Infinite loop | ||
while (1) | ||
{ |
15 changes: 15 additions & 0 deletions
15
ilg.gnuarmeclipse.templates.cortexm/templates/cortexm_project/src/main-30-semihosting.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
int seconds = 0; | ||
|
||
#define LOOP_COUNT (5) | ||
int loops = LOOP_COUNT; | ||
if (argc > 1) | ||
{ | ||
// If defined, get the number of loops from the command line, | ||
// configurable via semihosting. | ||
loops = atoi (argv[1]); | ||
} | ||
|
||
// Short loop. | ||
for (int i = 0; i < loops; i++) | ||
{ |
12 changes: 12 additions & 0 deletions
12
ilg.gnuarmeclipse.templates.cortexm/templates/cortexm_project/src/main-50-none.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
++seconds; | ||
|
||
// Count seconds on the trace device. | ||
trace_printf ("Second %d\n", seconds); | ||
} | ||
// Infinite loop, never return. | ||
} | ||
|
||
#pragma GCC diagnostic pop | ||
|
||
// ---------------------------------------------------------------------------- |
12 changes: 12 additions & 0 deletions
12
ilg.gnuarmeclipse.templates.cortexm/templates/cortexm_project/src/main-50-retarget.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
++seconds; | ||
|
||
// Count seconds on the trace device. | ||
trace_printf ("Second %d\n", seconds); | ||
} | ||
// Infinite loop, never return. | ||
} | ||
|
||
#pragma GCC diagnostic pop | ||
|
||
// ---------------------------------------------------------------------------- |
12 changes: 12 additions & 0 deletions
12
ilg.gnuarmeclipse.templates.cortexm/templates/cortexm_project/src/main-50-semihosting.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
++seconds; | ||
|
||
// Count seconds on the trace device. | ||
trace_printf ("Second %d\n", seconds); | ||
} | ||
return 0; | ||
} | ||
|
||
#pragma GCC diagnostic pop | ||
|
||
// ---------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.