Skip to content

Commit

Permalink
[example] Add Feather M4 blink example
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Rush authored and salkinium committed Jun 8, 2023
1 parent a2e095d commit fe3c24e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
- name: Examples SAMD Devices
if: always()
run: |
(cd examples && ../tools/scripts/examples_compile.py samd samd21_xplained_pro)
(cd examples && ../tools/scripts/examples_compile.py feather_m4 samd samd21_xplained_pro)
- name: Examples SAMG Devices
if: always()
run: |
Expand Down
40 changes: 40 additions & 0 deletions examples/feather_m4/blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2016-2017, Niklas Hauser
*
* 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>

using namespace Board;

int
main()
{
initialize();

// Use the logging streams to print some messages.
// Change MODM_LOG_LEVEL above to enable or disable these messages
MODM_LOG_DEBUG << "debug" << modm::endl;
MODM_LOG_INFO << "info" << modm::endl;
MODM_LOG_WARNING << "warning" << modm::endl;
MODM_LOG_ERROR << "error" << modm::endl;

uint32_t counter(0);

while (true)
{
Led::toggle();
modm::delay(500ms);

MODM_LOG_INFO << "loop: " << counter++ << modm::endl;
}

return 0;
}

10 changes: 10 additions & 0 deletions examples/feather_m4/blink/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<library>
<extends>modm:feather-m4</extends>
<options>
<option name="modm:build:build.path">../../../build/feather_m4/blink</option>
</options>
<modules>
<module>modm:build:scons</module>
<module>modm:architecture:delay</module>
</modules>
</library>

0 comments on commit fe3c24e

Please sign in to comment.