diff --git a/src/board/system76/addw2/board.c b/src/board/system76/addw2/board.c index e55af45..1d9b2f6 100644 --- a/src/board/system76/addw2/board.c +++ b/src/board/system76/addw2/board.c @@ -10,6 +10,7 @@ #include #include #include +#include extern uint8_t main_cycle; @@ -33,14 +34,7 @@ void board_init(void) { void board_event(void) { power_set_limit(); - // Read POST codes - while (P80H81HS & 1) { - uint8_t p80h = P80HD; - uint8_t p81h = P81HD; - P80H81HS |= 1; - - DEBUG("POST %02X%02X\n", p81h, p80h); - } + ec_read_post_codes(); if (main_cycle == 0) { // Set keyboard LEDs diff --git a/src/board/system76/bonw14/board.c b/src/board/system76/bonw14/board.c index 35f8a15..bd544d2 100644 --- a/src/board/system76/bonw14/board.c +++ b/src/board/system76/bonw14/board.c @@ -9,6 +9,7 @@ #include #include #include +#include extern uint8_t main_cycle; @@ -37,12 +38,5 @@ void board_init(void) { void board_event(void) { power_set_limit(); - // Read POST codes - while (P80H81HS & 1) { - uint8_t p80h = P80HD; - uint8_t p81h = P81HD; - P80H81HS |= 1; - - DEBUG("POST %02X%02X\n", p81h, p80h); - } + ec_read_post_codes(); } diff --git a/src/board/system76/darp7/board.c b/src/board/system76/darp7/board.c index 3873b08..f05502b 100644 --- a/src/board/system76/darp7/board.c +++ b/src/board/system76/darp7/board.c @@ -6,6 +6,7 @@ #include #include #include +#include extern uint8_t main_cycle; @@ -34,12 +35,5 @@ void board_init(void) { void board_event(void) { espi_event(); - // Read POST codes - while (P80H81HS & 1) { - uint8_t p80h = P80HD; - uint8_t p81h = P81HD; - P80H81HS |= 1; - - DEBUG("POST %02X%02X\n", p81h, p80h); - } + ec_read_post_codes(); } diff --git a/src/board/system76/galp5/board.c b/src/board/system76/galp5/board.c index 7788c02..8855ba3 100644 --- a/src/board/system76/galp5/board.c +++ b/src/board/system76/galp5/board.c @@ -8,6 +8,7 @@ #include #include #include +#include extern uint8_t main_cycle; @@ -44,12 +45,5 @@ void board_event(void) { espi_event(); - // Read POST codes - while (P80H81HS & 1) { - uint8_t p80h = P80HD; - uint8_t p81h = P81HD; - P80H81HS |= 1; - - DEBUG("POST %02X%02X\n", p81h, p80h); - } + ec_read_post_codes(); } diff --git a/src/board/system76/gaze15/board.c b/src/board/system76/gaze15/board.c index 31a7471..b479f3f 100644 --- a/src/board/system76/gaze15/board.c +++ b/src/board/system76/gaze15/board.c @@ -9,6 +9,7 @@ #include #include #include +#include extern uint8_t main_cycle; @@ -33,12 +34,5 @@ void board_init(void) { void board_event(void) { power_set_limit(); - // Read POST codes - while (P80H81HS & 1) { - uint8_t p80h = P80HD; - uint8_t p81h = P81HD; - P80H81HS |= 1; - - DEBUG("POST %02X%02X\n", p81h, p80h); - } + ec_read_post_codes(); } diff --git a/src/board/system76/lemp10/board.c b/src/board/system76/lemp10/board.c index 135220b..8a336ca 100644 --- a/src/board/system76/lemp10/board.c +++ b/src/board/system76/lemp10/board.c @@ -6,6 +6,7 @@ #include #include #include +#include extern uint8_t main_cycle; @@ -36,12 +37,5 @@ void board_init(void) { void board_event(void) { espi_event(); - // Read POST codes - while (P80H81HS & 1) { - uint8_t p80h = P80HD; - uint8_t p81h = P81HD; - P80H81HS |= 1; - - DEBUG("POST %02X%02X\n", p81h, p80h); - } + ec_read_post_codes(); } diff --git a/src/board/system76/oryp6/board.c b/src/board/system76/oryp6/board.c index 35f8a15..bd544d2 100644 --- a/src/board/system76/oryp6/board.c +++ b/src/board/system76/oryp6/board.c @@ -9,6 +9,7 @@ #include #include #include +#include extern uint8_t main_cycle; @@ -37,12 +38,5 @@ void board_init(void) { void board_event(void) { power_set_limit(); - // Read POST codes - while (P80H81HS & 1) { - uint8_t p80h = P80HD; - uint8_t p81h = P81HD; - P80H81HS |= 1; - - DEBUG("POST %02X%02X\n", p81h, p80h); - } + ec_read_post_codes(); } diff --git a/src/board/system76/oryp7/board.c b/src/board/system76/oryp7/board.c index 25b357c..982517e 100644 --- a/src/board/system76/oryp7/board.c +++ b/src/board/system76/oryp7/board.c @@ -9,6 +9,7 @@ #include #include #include +#include extern uint8_t main_cycle; @@ -36,12 +37,5 @@ void board_init(void) { void board_event(void) { power_set_limit(); - // Read POST codes - while (P80H81HS & 1) { - uint8_t p80h = P80HD; - uint8_t p81h = P81HD; - P80H81HS |= 1; - - DEBUG("POST %02X%02X\n", p81h, p80h); - } + ec_read_post_codes(); }