Skip to content

Commit

Permalink
Proper fix for textbox UART hang/crash
Browse files Browse the repository at this point in the history
THANK YOU @0xchocolate
  • Loading branch information
Willy-JL committed Mar 22, 2024
1 parent 04ecef4 commit c7d1880
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions applications/services/gui/modules/text_box.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ static void text_box_insert_endline(Canvas* canvas, TextBoxModel* model) {
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++) {
// Debugger shows it's stuck in this loop, but it also shows the while condition is false??
for(size_t i = 0; i < line_num - lines_on_screen; i++) {
while(model->text_pos < end) {
if(*model->text_pos++ == '\n') break;
}
Expand Down

0 comments on commit c7d1880

Please sign in to comment.