diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f859285..8fc36371 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ name: Build firmware on: push: branches: ['**'] + pull_request: jobs: build: diff --git a/httpd/httpd.c b/httpd/httpd.c index 41a3fc65..fb9c678f 100644 --- a/httpd/httpd.c +++ b/httpd/httpd.c @@ -344,7 +344,7 @@ __xdata uint8_t *scan_header(__xdata uint8_t * __xdata p) read_reg_timer(&now); - if (session) { + if (session && session_id[0]) { if (now - last_session_use > session_timeout) { dbg_string("Session expired\n"); } else { diff --git a/machine.c b/machine.c index aeb8d5bc..1c2fee14 100644 --- a/machine.c +++ b/machine.c @@ -1182,6 +1182,7 @@ __code const struct machine machine = { 0 }, }, +}; #elif defined MACHINE_POE_2G080110GS __code const struct machine machine = { .machine_name = "MokerLink POE-2G080110GS", diff --git a/machine.h b/machine.h index b6d4a825..14fc5c13 100644 --- a/machine.h +++ b/machine.h @@ -44,6 +44,7 @@ // #define MACHINE_SWTG024AS_V2_0 // #define MACHINE_FG_4GT_2SX_V2_0 // #define MACHINE_FG_8GT_1SX +// #define MACHINE_LIANGUO_HYWS_SGT0108S // #define MACHINE_POE_2G080110GS typedef struct { diff --git a/rtl837x_flash.c b/rtl837x_flash.c index 5f04c88a..2ec5bc3f 100644 --- a/rtl837x_flash.c +++ b/rtl837x_flash.c @@ -221,7 +221,9 @@ void flash_read_jedecid(void) */ void flash_read_bulk(__xdata uint8_t *dst) { - short status; + if (!flash_region.len) + return; + flash_configure_sio(); while (flash_read_status() & STATUS_REG_BUSY_MASK); flash_configure_mmio(); @@ -258,6 +260,9 @@ void flash_read_bulk(__xdata uint8_t *dst) void flash_read_security(void) { + if (!flash_region.len) + return; + flash_configure_sio(); while (flash_read_status() & STATUS_REG_BUSY_MASK);