Skip to content

Commit

Permalink
[example] Add Nucleo-L552ZE-Q freertos blink example
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-durand committed Jan 17, 2022
1 parent fdd4db9 commit 450504d
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
49 changes: 49 additions & 0 deletions examples/nucleo_l552ze-q/freertos_blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2020, Mike Wolfram
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

#include <modm/board.hpp>
#include <modm/processing/rtos.hpp>

using namespace Board;

class BlinkTask : modm::rtos::Thread
{
public:
BlinkTask()
: Thread(4, 2048, "blink")
{}

void
run()
{
Leds::setOutput();
while (true)
{
vTaskDelay(500 * (configTICK_RATE_HZ / 1000.0));
Leds::toggle();
}
}
};

BlinkTask blinkTask;

int
main()
{
Board::initialize();

MODM_LOG_INFO << "\n\nReboot: FreeRTOS blink example" << modm::endl;

modm::rtos::Scheduler::schedule();

// we should never get here
return 0;
}
11 changes: 11 additions & 0 deletions examples/nucleo_l552ze-q/freertos_blink/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<library>
<extends>modm:nucleo-l552ze-q</extends>
<options>
<option name="modm:build:build.path">../../../build/nucleo_l552ze-q/freertos_blink</option>
</options>
<modules>
<module>modm:build:scons</module>
<module>modm:freertos</module>
<module>modm:processing:rtos</module>
</modules>
</library>

0 comments on commit 450504d

Please sign in to comment.