Skip to content

Commit 864f523

Browse files
committed
[examples] Deduplicate hard_fault examples
1 parent cde6d5e commit 864f523

File tree

7 files changed

+17
-215
lines changed

7 files changed

+17
-215
lines changed

examples/nucleo_f103rb/hard_fault/main.cpp renamed to examples/core/hard_fault/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ void function1(uint32_t bla)
1919

2020
if (Button::read()) {
2121
// execute undefined instructed
22-
// the hard fault handler will blink the blue LED
23-
// or, if the debugger is connected, will trigger a breakpoint
2422
asm volatile (".short 0xde00");
2523
}
2624
}
@@ -69,9 +67,11 @@ main()
6967

7068
MODM_LOG_INFO << "Hold Button to cause a Hardfault!" << modm::endl;
7169

70+
#ifdef CoreDebug_DHCSR_C_DEBUGEN_Msk
7271
if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) {
7372
MODM_LOG_INFO << "Debugger connected!" << modm::endl;
7473
}
74+
#endif
7575

7676
while (true)
7777
{

examples/core/hard_fault/project.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<library>
2+
<extends>modm:nucleo-f072rb</extends>
3+
<!-- <extends>modm:nucleo-f103rb</extends> -->
4+
<!-- <extends>modm:nucleo-f446ze</extends> -->
5+
<!-- <extends>modm:nucleo-f746zg</extends> -->
6+
<!-- <extends>modm:nucleo-g071rb</extends> -->
7+
<!-- <extends>modm:nucleo-h743zi</extends> -->
8+
<!-- <extends>modm:nucleo-l552ze-q</extends> -->
9+
<!-- <extends>modm:nucleo-u575zi-q</extends> -->
10+
<modules>
11+
<module>modm:platform:fault</module>
12+
<module>modm:platform:heap</module>
13+
<module>modm:build:scons</module>
14+
</modules>
15+
</library>

examples/nucleo_f103rb/hard_fault/project.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/stm32f072_discovery/hard_fault/main.cpp

Lines changed: 0 additions & 90 deletions
This file was deleted.

examples/stm32f072_discovery/hard_fault/project.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/stm32f469_discovery/hard_fault/main.cpp

Lines changed: 0 additions & 93 deletions
This file was deleted.

examples/stm32f469_discovery/hard_fault/project.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)