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.
Dependencies: mbed mbed-rtos ShiftReg2 TextLCD
POST/Post.cpp@4:020f93d35f6e, 2019-05-07 (annotated)
- Committer:
- thomasmorris
- Date:
- Tue May 07 21:55:57 2019 +0000
- Revision:
- 4:020f93d35f6e
Added mutex and safey coding needs more. Added board and serial functions that need testing. As well as a more thorough post function.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thomasmorris | 4:020f93d35f6e | 1 | #include "Post.hpp" |
thomasmorris | 4:020f93d35f6e | 2 | int POST_Sum = 0; |
thomasmorris | 4:020f93d35f6e | 3 | bool Power_Post = 0; |
thomasmorris | 4:020f93d35f6e | 4 | bool Interface_Post = 0; |
thomasmorris | 4:020f93d35f6e | 5 | bool Schedules_Post = 0; |
thomasmorris | 4:020f93d35f6e | 6 | bool Feedback_Post = 0; |
thomasmorris | 4:020f93d35f6e | 7 | bool Serial_PC_Post = 0; |
thomasmorris | 4:020f93d35f6e | 8 | bool Serial_BOARD_Post = 0; |
thomasmorris | 4:020f93d35f6e | 9 | |
thomasmorris | 4:020f93d35f6e | 10 | |
thomasmorris | 4:020f93d35f6e | 11 | INTERFACE INTERFACE_1(PC_13,PC_14,PC_15,PB_9,PB_8,PB_5,PB_4,PA_15,PA_12,PA_11,PA_10);//Rotary encoderA, Rotary Encoder B, Rotary encoder button, button 1, button 2, button 3, MOSFET safety, shift sclk, shift latch, shift enable, shift in |
thomasmorris | 4:020f93d35f6e | 12 | SCHEDULES SCHEDULES_1; |
thomasmorris | 4:020f93d35f6e | 13 | FEEDBACK FEEDBACK_1(PA_0,PA_1,PA_2,PA_3,PB_0,PB_1,PA_7,PA_6,PA_5,PA_4);//This is where all of the feedback pins are defined |
thomasmorris | 4:020f93d35f6e | 14 | SERIAL_PC SERIAL_PC_1; |
thomasmorris | 4:020f93d35f6e | 15 | SERIAL_BOARD SERIAL_BOARD_1; |
thomasmorris | 4:020f93d35f6e | 16 | void POST() |
thomasmorris | 4:020f93d35f6e | 17 | { |
thomasmorris | 4:020f93d35f6e | 18 | POST_Sum = 0; |
thomasmorris | 4:020f93d35f6e | 19 | Interface_Post = INTERFACE_1.Post(); |
thomasmorris | 4:020f93d35f6e | 20 | Schedules_Post = SCHEDULES_1.Post(); |
thomasmorris | 4:020f93d35f6e | 21 | Feedback_Post = FEEDBACK_1.Post(); |
thomasmorris | 4:020f93d35f6e | 22 | Serial_PC_Post = SERIAL_PC_1.Post(); |
thomasmorris | 4:020f93d35f6e | 23 | Serial_BOARD_Post = SERIAL_BOARD_1.Post(); |
thomasmorris | 4:020f93d35f6e | 24 | |
thomasmorris | 4:020f93d35f6e | 25 | if(Interface_Post == 1)//Success |
thomasmorris | 4:020f93d35f6e | 26 | { |
thomasmorris | 4:020f93d35f6e | 27 | PC.printf("Interface Post pass\n"); |
thomasmorris | 4:020f93d35f6e | 28 | POST_Sum = POST_Sum + 1; |
thomasmorris | 4:020f93d35f6e | 29 | } |
thomasmorris | 4:020f93d35f6e | 30 | else if(Interface_Post != 1)//Fail |
thomasmorris | 4:020f93d35f6e | 31 | { |
thomasmorris | 4:020f93d35f6e | 32 | PC.printf("Interface Post fail\n"); |
thomasmorris | 4:020f93d35f6e | 33 | } |
thomasmorris | 4:020f93d35f6e | 34 | if(Schedules_Post == 1)//Success |
thomasmorris | 4:020f93d35f6e | 35 | { |
thomasmorris | 4:020f93d35f6e | 36 | PC.printf("Schedules Post Pass\n"); |
thomasmorris | 4:020f93d35f6e | 37 | POST_Sum = POST_Sum + 1; |
thomasmorris | 4:020f93d35f6e | 38 | } |
thomasmorris | 4:020f93d35f6e | 39 | else if (Schedules_Post != 1)//Fail |
thomasmorris | 4:020f93d35f6e | 40 | { |
thomasmorris | 4:020f93d35f6e | 41 | PC.printf("Schedules Post fail\n"); |
thomasmorris | 4:020f93d35f6e | 42 | } |
thomasmorris | 4:020f93d35f6e | 43 | if(Feedback_Post == 1)//Success |
thomasmorris | 4:020f93d35f6e | 44 | { |
thomasmorris | 4:020f93d35f6e | 45 | PC.printf("Feedback Post Pass\n"); |
thomasmorris | 4:020f93d35f6e | 46 | POST_Sum = POST_Sum + 1; |
thomasmorris | 4:020f93d35f6e | 47 | } |
thomasmorris | 4:020f93d35f6e | 48 | else if(Feedback_Post != 1)//Fail |
thomasmorris | 4:020f93d35f6e | 49 | { |
thomasmorris | 4:020f93d35f6e | 50 | PC.printf("Feedback Post Fail\n"); |
thomasmorris | 4:020f93d35f6e | 51 | } |
thomasmorris | 4:020f93d35f6e | 52 | if(Serial_PC_Post == 1)//Success |
thomasmorris | 4:020f93d35f6e | 53 | { |
thomasmorris | 4:020f93d35f6e | 54 | PC.printf("Serial PC Post Pass\n"); |
thomasmorris | 4:020f93d35f6e | 55 | POST_Sum = POST_Sum + 1; |
thomasmorris | 4:020f93d35f6e | 56 | } |
thomasmorris | 4:020f93d35f6e | 57 | else if(Serial_PC_Post != 1)//Fail |
thomasmorris | 4:020f93d35f6e | 58 | { |
thomasmorris | 4:020f93d35f6e | 59 | PC.printf("Serial PC Post Fail\n"); |
thomasmorris | 4:020f93d35f6e | 60 | } |
thomasmorris | 4:020f93d35f6e | 61 | if(Serial_BOARD_Post == 1)//Pass |
thomasmorris | 4:020f93d35f6e | 62 | { |
thomasmorris | 4:020f93d35f6e | 63 | PC.printf("Serial Board Pass\n"); |
thomasmorris | 4:020f93d35f6e | 64 | POST_Sum = POST_Sum + 1; |
thomasmorris | 4:020f93d35f6e | 65 | } |
thomasmorris | 4:020f93d35f6e | 66 | else if (Serial_BOARD_Post != 1)//Fail |
thomasmorris | 4:020f93d35f6e | 67 | { |
thomasmorris | 4:020f93d35f6e | 68 | PC.printf("Serial Board Fail\n"); |
thomasmorris | 4:020f93d35f6e | 69 | } |
thomasmorris | 4:020f93d35f6e | 70 | if(POST_Sum == 5) |
thomasmorris | 4:020f93d35f6e | 71 | { |
thomasmorris | 4:020f93d35f6e | 72 | PC.printf("Post Nominal\n"); |
thomasmorris | 4:020f93d35f6e | 73 | } |
thomasmorris | 4:020f93d35f6e | 74 | } |