-
Notifications
You must be signed in to change notification settings - Fork 150
/
Copy pathmain.cpp
43 lines (36 loc) · 927 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Copyright (c) 2010-2011, Fabian Greif
* Copyright (c) 2012-2013, 2015-2017, Niklas Hauser
* Copyright (c) 2014, Sascha Schade
*
* 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/platform.hpp>
#include <modm/processing/timer.hpp>
using namespace modm::platform;
using namespace std::chrono_literals;
// create a output device for the led
typedef GpioOutputB0 Led;
int
main()
{
SystemClock::enable();
Led::setOutput();
Led::reset();
// enable interrupts
enableInterrupts();
modm::ShortTimeout timeout(200ms);
while (true)
{
if (timeout.isExpired())
{
timeout.restart(200ms);
Led::toggle();
}
}
}