mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-11 06:09:08 -07:00
Temp fix for UART text box BusFault?
Attempts to fix BusFault with huge amount of fast data Still have weird hangs in some cases with huge amounts of data But this fixes crashes atleast Weird thing is that these hangs are not full, CLI keeps working for a few seconds
This commit is contained in:
@@ -103,8 +103,12 @@ static void text_box_insert_endline(Canvas* canvas, TextBoxModel* model) {
|
||||
uint8_t lines_on_screen = 56 / canvas_current_font_height(canvas);
|
||||
if(model->focus == TextBoxFocusEnd && line_num > lines_on_screen) {
|
||||
// Set text position to 5th line from the end
|
||||
const char* end = model->text + furi_string_size(model->text_formatted);
|
||||
// TODO: Find proper fix, this prevents BusFault but hangs GUI after another while? makes no sense
|
||||
for(uint8_t i = 0; i < line_num - lines_on_screen; i++) {
|
||||
while(*model->text_pos++ != '\n') {
|
||||
// Debugger shows it's stuck in this loop, but it also shows the while condition is false??
|
||||
while(model->text_pos < end) {
|
||||
if(*model->text_pos++ == '\n') break;
|
||||
}
|
||||
}
|
||||
model->scroll_num = line_num - (lines_on_screen - 1);
|
||||
|
||||
Reference in New Issue
Block a user