Demonstration of a spin lock

Dependencies:   ELEC350-Practicals-FZ429

Fork of Task617Solution-mbedos-FZ429 by University of Plymouth - Stages 1, 2 and 3

Revision:
7:bd75e7717b58
Parent:
6:d16ce38e9b8a
Child:
8:ad00c9036add
--- a/main.cpp	Mon Apr 03 11:38:04 2017 +0000
+++ b/main.cpp	Tue Oct 31 15:40:25 2017 +0000
@@ -6,19 +6,14 @@
 
 #define DELAY 200
 
-//Digital outputs
 DigitalOut onBoardLED(LED1);
-DigitalOut redLED(D7);
-DigitalOut yellowLED(D6);
-DigitalOut greenLED(D5);
+DigitalOut redLED(PE_15);
+DigitalOut yellowLED(PB_10);
+DigitalOut greenLED(PB_11);
 
-//Serial Interface
-Serial pc(USBTX, USBRX);
-
-//Digital inputs
 DigitalIn  onBoardSwitch(USER_BUTTON);
-DigitalIn  SW1(D4);
-DigitalIn  SW2(D3);
+DigitalIn  SW1(PE_12);
+DigitalIn  SW2(PE_14);
 
 //Thread ID for the Main function (CMSIS API)
 osThreadId tidMain;
@@ -31,7 +26,7 @@
 
 void thread1() 
 {
-    pc.printf("Entering thread 1\n");
+    printf("Entering thread 1\n");
     while (true) {
         yellowLED = 1;
         
@@ -59,7 +54,7 @@
 
 void thread2() 
 {
-    pc.printf("Entering thread 2\n");  
+    printf("Entering thread 2\n");  
     while (true) {
         redLED = 1;
         
@@ -102,7 +97,7 @@
     t1.start(thread1);
     t2.start(thread2);
     
-    pc.printf("Main Thread\n");
+    printf("Main Thread\n");
     while (true) {
         Thread::wait(osWaitForever);
     }