Skip to content

Commit 7c4a057

Browse files
committed
[example] Add Nucleo-L552ZE-Q freertos blink example
1 parent 4482ca0 commit 7c4a057

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright (c) 2020, Mike Wolfram
3+
*
4+
* This file is part of the modm project.
5+
*
6+
* This Source Code Form is subject to the terms of the Mozilla Public
7+
* License, v. 2.0. If a copy of the MPL was not distributed with this
8+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
*/
10+
// ----------------------------------------------------------------------------
11+
12+
#include <modm/board.hpp>
13+
#include <modm/processing/rtos.hpp>
14+
15+
using namespace Board;
16+
17+
class BlinkTask : modm::rtos::Thread
18+
{
19+
public:
20+
BlinkTask()
21+
: Thread(4, 2048, "blink")
22+
{}
23+
24+
void
25+
run()
26+
{
27+
Leds::setOutput();
28+
while (true)
29+
{
30+
vTaskDelay(500 * (configTICK_RATE_HZ / 1000.0));
31+
Leds::toggle();
32+
}
33+
}
34+
};
35+
36+
BlinkTask blinkTask;
37+
38+
int
39+
main()
40+
{
41+
Board::initialize();
42+
43+
MODM_LOG_INFO << "\n\nReboot: FreeRTOS blink example" << modm::endl;
44+
45+
modm::rtos::Scheduler::schedule();
46+
47+
// we should never get here
48+
return 0;
49+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<library>
2+
<extends>modm:nucleo-l552ze-q</extends>
3+
<options>
4+
<option name="modm:build:build.path">../../../build/nucleo_l552ze-q/freertos_blink</option>
5+
</options>
6+
<modules>
7+
<module>modm:build:scons</module>
8+
<module>modm:freertos</module>
9+
<module>modm:processing:rtos</module>
10+
</modules>
11+
</library>

0 commit comments

Comments
 (0)