Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 4:e1c35030b91a
- Parent:
- 3:e5c2bfd464f7
- Child:
- 5:70f6171496af
--- a/main.cpp Wed Sep 18 10:17:32 2019 +0000
+++ b/main.cpp Wed Sep 18 10:28:12 2019 +0000
@@ -5,7 +5,7 @@
#define PRESSED 1
#ifdef TARGET_NUCLEO_F429ZI
-//#define ONBOARD
+#define ONBOARD
#endif
#ifdef ONBOARD
@@ -29,6 +29,7 @@
//RED MEANS THE COUNT UP FUNCTION IS IN ITS CRITICAL SECTION
red_led = 1;
for (unsigned int n=0; n<N; n++) {
+ CriticalSectionLock::enable();
counter++;
counter++;
counter++;
@@ -39,7 +40,7 @@
counter++;
counter++;
counter++;
-
+ CriticalSectionLock::disable();
}
red_led = 0;
@@ -55,6 +56,7 @@
//YELLOW MEANS THE COUNT DOWN FUNCTION IS IN ITS CRITICAL SECTION
yellow_led = 1;
for (unsigned int n=0; n<N; n++) {
+ CriticalSectionLock::enable();
counter--;
counter--;
counter--;
@@ -64,7 +66,8 @@
counter--;
counter--;
counter--;
- counter--;
+ counter--;
+ CriticalSectionLock::disable();
}
yellow_led = 0;