diff --git a/examples/stm32f469_discovery/exceptions_rtti/main.cpp b/examples/stm32f469_discovery/exceptions_rtti/main.cpp new file mode 100644 index 0000000000..9d6802f12b --- /dev/null +++ b/examples/stm32f469_discovery/exceptions_rtti/main.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020, 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 +#include + +using namespace Board; + +// ---------------------------------------------------------------------------- +int +main() +{ + Board::initialize(); + LedD13::setOutput(modm::Gpio::Low); + uint32_t counter(0); + + MODM_LOG_INFO << "TypeId for LedD13: " << typeid(LedD13).name() << modm::endl; + + while (true) + { + LedBlue::toggle(); + modm::delayMilliseconds(500); + + try { + throw counter++; + } + catch (uint32_t code) { + MODM_LOG_ERROR << "Caught exception #" << code << modm::endl; + } + } + + return 0; +} diff --git a/examples/stm32f469_discovery/exceptions_rtti/project.xml b/examples/stm32f469_discovery/exceptions_rtti/project.xml new file mode 100644 index 0000000000..3a799f27f2 --- /dev/null +++ b/examples/stm32f469_discovery/exceptions_rtti/project.xml @@ -0,0 +1,12 @@ + + modm:disco-f469ni + + + + + + + modm:platform:gpio + modm:build:scons + +