Check this one ! mbos setup changed, WTX hor pos changed, no font style check, no checksum check
Dependencies: 4DGL MODSERIAL mbed mbos
Fork of CDU_Mbed_21 by
show_data.cpp@11:d60c746c097c, 2014-07-21 (annotated)
- Committer:
- WillemBraat
- Date:
- Mon Jul 21 14:24:15 2014 +0000
- Revision:
- 11:d60c746c097c
- Parent:
- 8:422544d24df3
screen_handler.cpp
; Added external flag S_Exec in procedure . Inhibits screen updates when 1. S_Exec is declared in line 77 of FS2CDU_data_5.cpp
;
; keyboard2.cpp
; Line 40. Added Key_led=0
;
; keyboard2.cpp "
; Added switch value in CDU_SET_BGL_INTENSIT...
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
LvdK | 7:6576a287e563 | 1 | // L. van der Kolk, ELVEDEKA, Holland // |
LvdK | 7:6576a287e563 | 2 | // File: show_data.cpp |
LvdK | 7:6576a287e563 | 3 | |
LvdK | 8:422544d24df3 | 4 | // ----- FOR DEBUG ONLY ---------------------------- |
LvdK | 7:6576a287e563 | 5 | // - Functions to test received and updated CDU data |
LvdK | 8:422544d24df3 | 6 | // -------------------------------------------------- |
LvdK | 7:6576a287e563 | 7 | |
LvdK | 7:6576a287e563 | 8 | #include "mbed.h" |
LvdK | 7:6576a287e563 | 9 | #include "MODSERIAL.h" |
LvdK | 7:6576a287e563 | 10 | #include "mbos.h" |
LvdK | 8:422544d24df3 | 11 | #include "mbos_def2.h" |
LvdK | 7:6576a287e563 | 12 | #include "FS_datastructures.h" |
LvdK | 7:6576a287e563 | 13 | |
LvdK | 7:6576a287e563 | 14 | extern mbos CDU_OS; |
LvdK | 7:6576a287e563 | 15 | extern MODSERIAL SERIAL_DEBUG; |
LvdK | 8:422544d24df3 | 16 | extern int FSdata_received_flag; |
LvdK | 8:422544d24df3 | 17 | |
LvdK | 8:422544d24df3 | 18 | int step_counter = 0; |
LvdK | 7:6576a287e563 | 19 | |
LvdK | 7:6576a287e563 | 20 | void test_update_flags() |
LvdK | 7:6576a287e563 | 21 | { |
LvdK | 8:422544d24df3 | 22 | // Test if DCU data was updated: |
LvdK | 7:6576a287e563 | 23 | |
LvdK | 7:6576a287e563 | 24 | // Background_Col_Update : 1 when color was updated, must be reset to 0 when data has been read |
LvdK | 7:6576a287e563 | 25 | // CDU_Status_Update : 1 when status was updated, must be reset to 0 when data has been read |
LvdK | 7:6576a287e563 | 26 | // DO_CLR_SCREEN : 1 when screen should be cleared, must be reset to 0 when done |
LvdK | 7:6576a287e563 | 27 | // Text_Line_Update : equal to line number whose text was updated, must be reset to 0 when text has been read |
LvdK | 7:6576a287e563 | 28 | // Key_Maintext_Update : equal to keynumber whose main text line was updated, must be reset to -1 text has been read |
LvdK | 7:6576a287e563 | 29 | // Key_Subtext_Update : equal to keynumber whose sub text line was updated, must be reset to -1 text has been read |
LvdK | 7:6576a287e563 | 30 | |
LvdK | 7:6576a287e563 | 31 | if ( Text_Line_Update != 0 ) { //: textline was updated ! |
LvdK | 7:6576a287e563 | 32 | // read textline data and print: |
LvdK | 8:422544d24df3 | 33 | SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n"); |
LvdK | 7:6576a287e563 | 34 | SERIAL_DEBUG.printf("line : %d\r\n",Text_Line_Update ); // show line nr |
LvdK | 7:6576a287e563 | 35 | //SERIAL_DEBUG.printf("WTX begin pos : %d\r\n",pos ); // show begin position |
LvdK | 7:6576a287e563 | 36 | SERIAL_DEBUG.printf("fontsize is : %d\r\n",TEXTLINE[Text_Line_Update].font_size ); // show fontsize |
LvdK | 7:6576a287e563 | 37 | SERIAL_DEBUG.printf("fontstyle is: %c\r\n",TEXTLINE[Text_Line_Update].font_style); // show fontstyle |
LvdK | 7:6576a287e563 | 38 | SERIAL_DEBUG.printf("R_colour is : %d\r\n",TEXTLINE[Text_Line_Update].text_RED ); // show textcolour |
LvdK | 7:6576a287e563 | 39 | SERIAL_DEBUG.printf("G_colour is : %d\r\n",TEXTLINE[Text_Line_Update].text_GREEN ); // show textcolour |
LvdK | 7:6576a287e563 | 40 | SERIAL_DEBUG.printf("B_colour is : %d\r\n",TEXTLINE[Text_Line_Update].text_BLUE ); // show textcolour |
LvdK | 7:6576a287e563 | 41 | SERIAL_DEBUG.printf("line text is: \r\n" ); |
LvdK | 7:6576a287e563 | 42 | SERIAL_DEBUG.printf("%s\r\n",TEXTLINE[Text_Line_Update].text ); // show line text |
LvdK | 8:422544d24df3 | 43 | |
LvdK | 8:422544d24df3 | 44 | Text_Line_Update = 0; // : reset FS data update ID flag |
LvdK | 8:422544d24df3 | 45 | } |
LvdK | 7:6576a287e563 | 46 | |
LvdK | 7:6576a287e563 | 47 | if ( Background_Col_Update != 0 ) { // : background colour was updated |
LvdK | 7:6576a287e563 | 48 | // read new colour data and print: |
LvdK | 8:422544d24df3 | 49 | SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n"); |
LvdK | 7:6576a287e563 | 50 | SERIAL_DEBUG.printf("background R_colour : %d\r\n",BACKGROUND_COL.BG_RED); |
LvdK | 7:6576a287e563 | 51 | SERIAL_DEBUG.printf("background G_colour : %d\r\n",BACKGROUND_COL.BG_GREEN); |
LvdK | 7:6576a287e563 | 52 | SERIAL_DEBUG.printf("background B_colour : %d\r\n",BACKGROUND_COL.BG_BLUE); |
LvdK | 8:422544d24df3 | 53 | |
LvdK | 8:422544d24df3 | 54 | Background_Col_Update = 0; // : reset FS data update ID flag |
LvdK | 7:6576a287e563 | 55 | } |
LvdK | 7:6576a287e563 | 56 | |
LvdK | 7:6576a287e563 | 57 | if ( CDU_Status_Update != 0 ) { // : CDU status was updated |
LvdK | 7:6576a287e563 | 58 | // read new status data and print: |
LvdK | 8:422544d24df3 | 59 | SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n" ); |
LvdK | 7:6576a287e563 | 60 | SERIAL_DEBUG.printf("Message indicator is : %d \r\n", CDU_STATUS.msg_indicator); |
LvdK | 7:6576a287e563 | 61 | SERIAL_DEBUG.printf("EXEC indicator is : %d \r\n", CDU_STATUS.exec_indicator); |
LvdK | 7:6576a287e563 | 62 | SERIAL_DEBUG.printf("Backlight is : %d \r\n", CDU_STATUS.backlight); |
LvdK | 7:6576a287e563 | 63 | SERIAL_DEBUG.printf("Standby mode is : %d \r\n", CDU_STATUS.stby_mode); |
LvdK | 8:422544d24df3 | 64 | |
LvdK | 8:422544d24df3 | 65 | CDU_Status_Update = 0; // : reset FS data update ID flag |
LvdK | 7:6576a287e563 | 66 | } |
LvdK | 7:6576a287e563 | 67 | |
LvdK | 7:6576a287e563 | 68 | if ( DO_CLR_SCREEN != 0 ) { // : clr screen request received |
LvdK | 8:422544d24df3 | 69 | SERIAL_DEBUG.printf("\r\r CLR screen request read:\r\n" ); |
LvdK | 7:6576a287e563 | 70 | SERIAL_DEBUG.printf("DO_CLR_CSCREEN : %d \r\n", DO_CLR_SCREEN ); |
LvdK | 8:422544d24df3 | 71 | |
LvdK | 8:422544d24df3 | 72 | DO_CLR_SCREEN = 0; |
LvdK | 7:6576a287e563 | 73 | } |
LvdK | 7:6576a287e563 | 74 | |
LvdK | 8:422544d24df3 | 75 | if (Key_Maintext_Update > -1) { // : key maintext was updated |
LvdK | 7:6576a287e563 | 76 | |
LvdK | 8:422544d24df3 | 77 | SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n"); |
LvdK | 8:422544d24df3 | 78 | //SERIAL_DEBUG.printf("Key number is : %d\r\n",Key_Maintext_Update); |
LvdK | 8:422544d24df3 | 79 | |
LvdK | 8:422544d24df3 | 80 | SERIAL_DEBUG.printf("Key MAINTEXT is : %s\r\n",SELKEY_MAINTEXT[50].text ); // show text |
LvdK | 8:422544d24df3 | 81 | SERIAL_DEBUG.printf("Key MAINTEXT is : %s\r\n",SELKEY_MAINTEXT[51].text ); // show text |
LvdK | 8:422544d24df3 | 82 | SERIAL_DEBUG.printf("Key MAINTEXT is : %s\r\n",SELKEY_MAINTEXT[52].text ); // show text |
LvdK | 8:422544d24df3 | 83 | |
LvdK | 8:422544d24df3 | 84 | //SERIAL_DEBUG.printf("Keyfontsize is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].font_size ); // show fontsize |
LvdK | 8:422544d24df3 | 85 | //SERIAL_DEBUG.printf("Key fontstyle is: %c\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].font_style); // show fontstyle |
LvdK | 8:422544d24df3 | 86 | //SERIAL_DEBUG.printf("Key R_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_RED ); // show textcolour |
LvdK | 8:422544d24df3 | 87 | //SERIAL_DEBUG.printf("Key G_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_GREEN ); // show textcolour |
LvdK | 8:422544d24df3 | 88 | //SERIAL_DEBUG.printf("Key B_colour is : %d\r\n",SELKEY_MAINTEXT[Key_Maintext_Update].text_BLUE ); // show textcolour |
LvdK | 8:422544d24df3 | 89 | |
LvdK | 8:422544d24df3 | 90 | Key_Maintext_Update = -1; |
LvdK | 8:422544d24df3 | 91 | |
LvdK | 8:422544d24df3 | 92 | step_counter=5; |
LvdK | 8:422544d24df3 | 93 | SERIAL_DEBUG.printf("step_counter: %d\r\n", step_counter ); // debug |
LvdK | 7:6576a287e563 | 94 | |
LvdK | 7:6576a287e563 | 95 | } |
LvdK | 7:6576a287e563 | 96 | |
LvdK | 8:422544d24df3 | 97 | if (Key_Subtext_Update > -1) { // : key subtext was updated |
LvdK | 7:6576a287e563 | 98 | |
LvdK | 8:422544d24df3 | 99 | SERIAL_DEBUG.printf("\r show data read from datastructure:\r\n"); |
LvdK | 7:6576a287e563 | 100 | SERIAL_DEBUG.printf("Key number is : %d\r\n",Key_Subtext_Update); |
LvdK | 7:6576a287e563 | 101 | SERIAL_DEBUG.printf("Key SUBTEXT is : %s\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].text ); // show text |
LvdK | 7:6576a287e563 | 102 | SERIAL_DEBUG.printf("Key fontsize is : %d\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].font_size ); // show fontsize |
LvdK | 7:6576a287e563 | 103 | SERIAL_DEBUG.printf("Key fontstyle is: %c\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].font_style); // show fontstyle |
LvdK | 7:6576a287e563 | 104 | SERIAL_DEBUG.printf("Key R_colour is : %d\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].text_RED ); // show textcolour |
LvdK | 7:6576a287e563 | 105 | SERIAL_DEBUG.printf("Key G_colour is : %d\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].text_GREEN ); // show textcolour |
LvdK | 7:6576a287e563 | 106 | SERIAL_DEBUG.printf("Key B_colour is : %d\r\n",SELKEY_SUBTEXT[Key_Subtext_Update].text_BLUE ); // show textcolour |
LvdK | 7:6576a287e563 | 107 | |
LvdK | 8:422544d24df3 | 108 | Key_Subtext_Update = -1; |
LvdK | 7:6576a287e563 | 109 | |
LvdK | 7:6576a287e563 | 110 | } |
LvdK | 8:422544d24df3 | 111 | |
LvdK | 8:422544d24df3 | 112 | FSdata_received_flag = false; // : reset commomn FS data update flag |
LvdK | 8:422544d24df3 | 113 | step_counter = 10; |
LvdK | 8:422544d24df3 | 114 | SERIAL_DEBUG.printf("step_counter: %d\r\n", step_counter ); // debug |
LvdK | 7:6576a287e563 | 115 | |
LvdK | 7:6576a287e563 | 116 | } |