From 4f7dd5c6f3571fb7c2d87b896163fd9fd1d234f2 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 17 Aug 2024 23:56:18 -0500 Subject: [PATCH] Update: Add additional signal checks in loops. --- level_3/fss_read/c/main/print/data.c | 4 ++++ level_3/fss_read/c/main/process_normal.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/level_3/fss_read/c/main/print/data.c b/level_3/fss_read/c/main/print/data.c index 7f8cf20..c9e2c84 100644 --- a/level_3/fss_read/c/main/print/data.c +++ b/level_3/fss_read/c/main/print/data.c @@ -57,6 +57,8 @@ extern "C" { // Loop through with conditionals only when necessary for performance reasons. for (print_state |= 0x8; i < main->setting.contents.array[at].used; ++i) { + if (fss_read_signal_check(main)) return F_status_set_error(F_interrupt); + if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) { print_state &= ~0x8; @@ -78,6 +80,8 @@ extern "C" { for (; i < main->setting.contents.array[at].used; ++i) { + if (fss_read_signal_check(main)) return F_status_set_error(F_interrupt); + if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) { if (main->callback.print_content_next) { main->callback.print_content_next(&main->program.output); diff --git a/level_3/fss_read/c/main/process_normal.c b/level_3/fss_read/c/main/process_normal.c index 6f6561b..157aa9e 100644 --- a/level_3/fss_read/c/main/process_normal.c +++ b/level_3/fss_read/c/main/process_normal.c @@ -410,6 +410,9 @@ extern "C" { current = 0; for (i = 0; i < main->setting.contents.array[at].used; ++i) { + + if (fss_read_signal_check(main)) return; + if (main->setting.contents.array[at].array[i].start <= main->setting.contents.array[at].array[i].stop) ++current; } // for @@ -582,6 +585,8 @@ extern "C" { for (i = 0; i < main->setting.contents.array[at].used; ++i) { + if (fss_read_signal_check(main)) return; + range.start = main->setting.contents.array[at].array[i].start; range.stop = main->setting.contents.array[at].array[i].stop; -- 1.8.3.1