Added the pin outs

Dependencies:   mbed mbed-rtos ShiftReg TextLCD

Files at this revision

API Documentation at this revision

Comitter:
thomasmorris
Date:
Thu Apr 11 18:12:31 2019 +0000
Parent:
5:20decc99e50c
Child:
7:d0159f675b30
Commit message:
Updated code 19:15

Changed in this revision

Feedback/Feedback.cpp Show annotated file Show diff for this revision Revisions of this file
Feedback/Feedback.hpp Show annotated file Show diff for this revision Revisions of this file
Interface/Interface.cpp Show annotated file Show diff for this revision Revisions of this file
Interface/Interface.hpp Show annotated file Show diff for this revision Revisions of this file
Post/Post.cpp Show annotated file Show diff for this revision Revisions of this file
Setup.hpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Feedback/Feedback.cpp	Thu Apr 11 11:51:16 2019 +0000
+++ b/Feedback/Feedback.cpp	Thu Apr 11 18:12:31 2019 +0000
@@ -8,7 +8,10 @@
     return 1;//Success
 }
 
-void FEEDBACK_test()
+void FEEDBACK::Test()
 {
-    sleep();    //Do something here
+    while(1)
+    {
+        Thread::signal_wait(1);//Sleep thread   
+    }
 }
\ No newline at end of file
--- a/Feedback/Feedback.hpp	Thu Apr 11 11:51:16 2019 +0000
+++ b/Feedback/Feedback.hpp	Thu Apr 11 18:12:31 2019 +0000
@@ -3,14 +3,10 @@
 
 #include "mbed.h"
 #include "rtos.h"
-#include "TextLCD.h"
 
 //Libraries and header file includes
 
 
-extern Serial PC;    //TX, RX
-extern TextLCD Lcd; // rs, e, d4-d7
-
 class FEEDBACK
 {
     public://Public member functions and variables
@@ -18,7 +14,7 @@
     ~FEEDBACK();
     void Init();
     int Post();
-    void FEEDBACK_test();
+    void Test();
     //Public Functions
     
     //Public Variabls
--- a/Interface/Interface.cpp	Thu Apr 11 11:51:16 2019 +0000
+++ b/Interface/Interface.cpp	Thu Apr 11 18:12:31 2019 +0000
@@ -2,7 +2,7 @@
 //Define the variables here
 Serial PC(PB_10, PB_11);    //TX, RX
 TextLCD Lcd(PB_12, PB_13, PB_14, PB_15, PA_8, PA_9); // rs, e, d4-d7
-
+DigitalOut On_board_led(PC_13);//Onborad LED needs no pass in parameter
 
 INTERFACE::INTERFACE(){}
 INTERFACE::~INTERFACE(){}
@@ -11,6 +11,14 @@
 {
     return 1;//Success
 }
+void INTERFACE::On_board_LED_Flash()
+{
+    while(1)
+    {
+        On_board_led = !On_board_led;
+        Thread::wait(1000);
+    }
+}
 void INTERFACE::Serial()
 {
     while(1)
--- a/Interface/Interface.hpp	Thu Apr 11 11:51:16 2019 +0000
+++ b/Interface/Interface.hpp	Thu Apr 11 18:12:31 2019 +0000
@@ -10,7 +10,7 @@
 
 extern Serial PC;    //TX, RX
 extern TextLCD Lcd; // rs, e, d4-d7
-
+//extern DigitalOut On_board_led;//Onboard LED
 class INTERFACE
 {
     public://Public member functions and variables
@@ -20,6 +20,7 @@
     int Post();
     void Serial();
     void LCD();
+    void On_board_LED_Flash();
     //Public Functions
     
     //Public Variabls
@@ -29,7 +30,6 @@
     //Private Functions
     
     //Private Variables
-    
-    
+    //DigitalOut On_board_led;//Onboard LED
 };
 #endif //_INTERFACE_HPP_
\ No newline at end of file
--- a/Post/Post.cpp	Thu Apr 11 11:51:16 2019 +0000
+++ b/Post/Post.cpp	Thu Apr 11 18:12:31 2019 +0000
@@ -2,6 +2,7 @@
 POWER POWER_1(PA_10,PA_11,PB_0,PB_1);
 INTERFACE INTERFACE_1;
 SCHEDULES SCHEDULES_1;
+FEEDBACK FEEDBACK_1;
 void POST()
 {
     if(POWER_1.Post() == 1)//Success
@@ -28,4 +29,12 @@
     {
         PC.printf("Schedules Post fail\n");   
     }
+    if(FEEDBACK_1.Post() == 1)//Success
+    {
+        PC.printf("Feedback Post Pass\n");   
+    }
+    else if(FEEDBACK_1.Post() != 1)//Fail
+    {
+        PC.printf("Feedback Post Fail\n");   
+    }
 }
\ No newline at end of file
--- a/Setup.hpp	Thu Apr 11 11:51:16 2019 +0000
+++ b/Setup.hpp	Thu Apr 11 18:12:31 2019 +0000
@@ -21,10 +21,12 @@
 extern POWER POWER_1;
 extern INTERFACE INTERFACE_1;
 extern SCHEDULES SCHEDULES_1;
+extern FEEDBACK FEEDBACK_1;
 //ShiftReg SR1(PA_12, PA_11, PA_10);    //data, store, clock
 
 static Thread Serial_Thread;
 static Thread LCD_Thread;
 static Thread LED_Thread;
 static Thread Schedules_Thread;
+static Thread Feedback_Thread;
 #endif //_SETUP_HPP_
--- a/main.cpp	Thu Apr 11 11:51:16 2019 +0000
+++ b/main.cpp	Thu Apr 11 18:12:31 2019 +0000
@@ -1,10 +1,11 @@
 #include "Setup.hpp"
 
-DigitalOut myled(PC_13);//Needed to access definition of the led from the main
+
 void Serial_Function(){INTERFACE_1.Serial();}//Written inside the interface class and Serial function
 void LCD_Function(){INTERFACE_1.LCD();}//LCD output
-void Onboard_Led(){while(1){myled = !myled; Thread::wait(1000);}}//Blink an onboard LED to signal the board is operational
+void Onboard_Led(){}//Blink an onboard LED to signal the board is operational
 void Schedules_Function(){SCHEDULES_1.Schedules_output();}//Output shcedules data
+void Feedback_Function(){FEEDBACK_1.Test();}//Opperate feedback function
 int main()
 {   
     POST();//Run Power on self test
@@ -13,6 +14,7 @@
     LCD_Thread.start(LCD_Function);
     LED_Thread.start(Onboard_Led);
     Schedules_Thread.start(Schedules_Function);
+    Feedback_Thread.start(Feedback_Function);
     while(1)
     {
         Thread::signal_wait(1);//Sleep the main thread