mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-15 04:19:26 -07:00
Proper fix for textbox UART hang/crash
THANK YOU @0xchocolate
This commit is contained in:
@@ -104,9 +104,7 @@ static void text_box_insert_endline(Canvas* canvas, TextBoxModel* model) {
|
|||||||
if(model->focus == TextBoxFocusEnd && line_num > lines_on_screen) {
|
if(model->focus == TextBoxFocusEnd && line_num > lines_on_screen) {
|
||||||
// Set text position to 5th line from the end
|
// Set text position to 5th line from the end
|
||||||
const char* end = model->text + furi_string_size(model->text_formatted);
|
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(size_t i = 0; i < line_num - lines_on_screen; i++) {
|
||||||
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??
|
|
||||||
while(model->text_pos < end) {
|
while(model->text_pos < end) {
|
||||||
if(*model->text_pos++ == '\n') break;
|
if(*model->text_pos++ == '\n') break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user