Skip to content

Commit

Permalink
OSD Msg Len icreased to 180 chars, set limit of max UDP aggregated pa…
Browse files Browse the repository at this point in the history
…cket len for msp data
  • Loading branch information
tipoman9 committed Dec 20, 2024
1 parent 59b9fc1 commit 2f70ae7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef struct msp_cache_entry_s {

static msp_cache_entry_t *msp_message_cache[256]; // make a slot for all possible messages

static uint8_t frame_buffer[8192]; // buffer a whole frame of MSP commands until we get a draw command
static uint8_t frame_buffer[1024]; // buffer a whole frame of MSP commands until we get a draw command. needs to fit in UDP !
static uint32_t fb_cursor = 0;

static uint8_t message_buffer[256]; // only needs to be the maximum size of an MSP packet, we only care to fwd MSP
Expand Down Expand Up @@ -1043,7 +1043,7 @@ static bool first_wfb_read=true;
void fill(char* str)
{
unsigned int rxb_l, txb_l, cpu_l[7];
char out[180] = "";
char out[280] = "";
char param = 0;
int ipos = 0, opos = 0;

Expand Down Expand Up @@ -1296,7 +1296,7 @@ void remove_carriage_returns(char *out) {
out[j] = '\0'; // Null-terminate the modified string
}

char osdmsg[80];
char osdmsg[180];

bool DrawTextOnOSDBitmap(char* msg){
char *font;
Expand All @@ -1323,7 +1323,7 @@ bool DrawTextOnOSDBitmap(char* msg){
if (msg == NULL || strlen(msg)==0){
file = fopen(FECFile, "rb");
if (file != NULL){// New file, will have to render the font
bytesRead = fread(osdmsg, 1, 79 /*max buffer*/, file); //with files
bytesRead = fread(osdmsg, 1, 179 /*max buffer*/, file); //with files
fclose(file);
remove(FECFile);
osdmsg[bytesRead]=0;//end of string
Expand Down

0 comments on commit 2f70ae7

Please sign in to comment.