diff --git a/httpd/page_impl.c b/httpd/page_impl.c index efedfb7..5c66f99 100644 --- a/httpd/page_impl.c +++ b/httpd/page_impl.c @@ -10,6 +10,7 @@ #include #include "../phy.h" #include "../version.h" +#include "page_impl.h" #pragma codeseg BANK1 #pragma constseg BANK1 @@ -41,21 +42,6 @@ extern __xdata struct flash_region_t flash_region; __code uint8_t * __code HTTP_RESPONCE_JSON = "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n"; __code uint8_t * __code HTTP_RESPONCE_TXT = "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n\r\n"; -/* Convert only the lower nibble to ascii HEX char. - For convenience the upper nibble is masked out. -*/ -inline char itohex(uint8_t val) { - // Ignore upper nibble for convenience. - val &= 0x0f; - val -= 10; - - // 10 or above - if ((int8_t)val >= 0) - val += ('a' - '0' - 10); - - return val + ('0' + 10); -} - // Convert uint8_t to ascii HEX char push on html-buffer. void charhex_to_html(char c) { diff --git a/httpd/page_impl.h b/httpd/page_impl.h index 455b276..709cbd3 100644 --- a/httpd/page_impl.h +++ b/httpd/page_impl.h @@ -3,11 +3,26 @@ void send_counters(char port); void send_status(void); -void send_vlan(register uint16_t vlan); +void send_vlan(uint16_t vlan); void send_basic_info(void); void send_eee(void); void send_mirror(void); void send_config(void); void send_cmd_log(void); +/* Convert only the lower nibble to ascii HEX char. + For convenience the upper nibble is masked out. +*/ +inline char itohex(uint8_t val) { + // Ignore upper nibble for convenience. + val &= 0x0f; + val -= 10; + + // 10 or above + if ((int8_t)val >= 0) + val += ('a' - '0' - 10); + + return val + ('0' + 10); +} + #endif