Fix build error

This commit is contained in:
cpq
2023-06-16 15:57:18 +01:00
parent dd6bffdd0d
commit 2bab274056
2 changed files with 11 additions and 15 deletions
+5 -5
View File
@@ -127,7 +127,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/stm32/nucleo-f7" ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f7" ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
@@ -142,7 +142,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/stm32/nucleo-f4" ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-f4" ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
@@ -155,7 +155,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 3 }
- run: if ./test/match_changed_files.sh "^src|examples/stm32/nucleo-h7" ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/stm32/nucleo-h7" ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
@@ -166,7 +166,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/ti/ek-tm4c" ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/ti/ek-tm4c" ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
- run: echo GO=0 > $GITHUB_ENV ; if ./test/match_changed_files.sh "^src|examples/ti/ek-tm4c1294xl-baremetal" ; then echo GO=1 > $GITHUB_ENV ; fi
@@ -181,7 +181,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with: { fetch-depth: 2 }
- run: if ./test/match_changed_files.sh "^src|examples/rp2040/pico-w5500" ; then echo GO=1 >> $GITHUB_ENV ; fi
- run: if ./test/match_changed_files.sh "^src|examples/device-dashboard|examples/rp2040/pico-w5500" ; then echo GO=1 >> $GITHUB_ENV ; fi
- if: ${{ env.GO == 1 }}
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
- if: ${{ env.GO == 1 }}
+6 -10
View File
@@ -149,8 +149,8 @@ static void handle_stats_get(struct mg_connection *c) {
static size_t print_events(void (*out)(char, void *), void *ptr, va_list *ap) {
size_t len = 0;
int page_number = va_arg(*ap, int);
int start = (page_number - 1) * EVENTS_PER_PAGE;
int pageno = va_arg(*ap, int);
int start = (pageno - 1) * EVENTS_PER_PAGE;
int end = start + EVENTS_PER_PAGE;
for (int i = start; i < end && i < events_no; i++) {
@@ -166,17 +166,13 @@ static size_t print_events(void (*out)(char, void *), void *ptr, va_list *ap) {
}
static void handle_events_get(struct mg_connection *c, struct mg_str query) {
int page_number;
bool is_last_page;
int pageno;
// query is represented by 'page=<page_id>'
page_number = atoi(query.ptr + 5);
if (page_number > events_no / EVENTS_PER_PAGE + 1 || page_number < 1)
page_number = 1;
pageno = atoi(query.ptr + 5);
if (pageno > events_no / EVENTS_PER_PAGE + 1 || pageno < 1) pageno = 1;
mg_http_reply(c, 200, s_json_header, "{%m:[%M], %m:%d}", MG_ESC("arr"),
print_events, page_number,
MG_ESC("totalCount"), events_no);
print_events, pageno, MG_ESC("totalCount"), events_no);
}
static void handle_settings_set(struct mg_connection *c, struct mg_str body) {