diff -r 2da50a3d4e9f -r a4a007b3c42e src/display.cpp --- a/src/display.cpp Sat Nov 07 19:20:39 2020 +0100 +++ b/src/display.cpp Sat Nov 07 19:22:04 2020 +0100 @@ -42,42 +42,42 @@ // dimm the char number of the currently displayed string of the main area; // do this by printing a modifed version of the last displayed string // but only alphanumeric chars should be counted (not the punctuation) - static char txt[64]; char c; uint8_t len, i, j; // for which we need to look for the entry in the table for (i=0; i= len) break; // nothing to do - strncpy(txt, table[i].buffer, table[i].maxsize); - // look for the actual position of the char in the string (only alphanum) - // XXX very poor implementation... - for (j=0; (jn; j--) - { - txt[j+2] = txt[j]; - } - txt[n+2] = '\t'; - txt[n+1] = txt[n]; - txt[n] = '\t'; - txt[len+2] = 0x00; // make sure the string will be terminated - - ::printf("with '%s'\n", txt); - // now display this string - show(0x00, txt, 0); - break; } } } @@ -103,6 +103,7 @@ } else { + pixel_buffer_mutex.lock(); for (i=0; i 0) @@ -173,6 +174,7 @@ { uint8_t nbyte; uint8_t nbit; + uint16_t color; // flags for (uint8_t l=0; l<(sizeof(flags)/sizeof(flags[0])); ++l) { @@ -203,8 +205,9 @@ // draw frames (Alarm and Channel) for (uint8_t l=0; l<(sizeof(frames)/sizeof(frames[0])); ++l) { - uint16_t color; - if (intxt[0] & (1 << frames[l].flag)) // frame flags are on the 1st byte only + nbyte = frames[l].flag / 8; + nbit = frames[l].flag % 8; + if (intxt[nbyte] & (1 << nbit)) color = fgcolor/6; else color = bgcolor; @@ -223,6 +226,8 @@ break; } } + pixel_buffer_mutex.unlock(); + //free(txt); //this->copy_to_lcd(); }