Skip to content

Commit

Permalink
feat(example): Add AT bin version
Browse files Browse the repository at this point in the history
internal gitlab: 4fcb6dc5
  • Loading branch information
wujiangang committed Feb 6, 2018
1 parent b26fe7a commit c8255dd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
4 changes: 4 additions & 0 deletions examples/at/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ LDDIR = ../ld

CCFLAGS += -Os

ifdef ESP_AT_FW_VERSION
CCFLAGS += -DESP_AT_FW_VERSION=\"$(ESP_AT_FW_VERSION)\"
endif

TARGET_LDFLAGS = \
-nostdlib \
-Wl,-EL \
Expand Down
10 changes: 9 additions & 1 deletion examples/at/user/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,18 @@ user_rf_pre_init(void)
void ICACHE_FLASH_ATTR
user_init(void)
{
char buf[64] = {0};
char buf[128] = {0};
at_customLinkMax = 5;
at_init();
#ifdef ESP_AT_FW_VERSION
if ((ESP_AT_FW_VERSION != NULL) && (os_strlen(ESP_AT_FW_VERSION) < 64)) {
os_sprintf(buf,"compile time:%s %s\r\n"ESP_AT_FW_VERSION,__DATE__,__TIME__);
} else {
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
}
#else
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
#endif
at_set_custom_info(buf);
at_port_print("\r\nready\r\n");
at_cmd_array_regist(&at_custom_cmd[0], sizeof(at_custom_cmd)/sizeof(at_custom_cmd[0]));
Expand Down
4 changes: 4 additions & 0 deletions examples/at_sdio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ LDDIR = ../ld

CCFLAGS += -Os

ifdef ESP_AT_FW_VERSION
CCFLAGS += -DESP_AT_FW_VERSION=\"$(ESP_AT_FW_VERSION)\"
endif

TARGET_LDFLAGS = \
-nostdlib \
-Wl,-EL \
Expand Down
10 changes: 9 additions & 1 deletion examples/at_sdio/user/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,21 @@ extern void at_custom_uart_rx_buffer_fetch_cb(void);

void ICACHE_FLASH_ATTR user_init(void)
{
char buf[64] = {0};
char buf[128] = {0};
at_customLinkMax = 5;
sdio_slave_init();
sdio_register_recv_cb(sdio_recv_data_callback);
at_init();
at_register_uart_rx_buffer_fetch_cb(at_custom_uart_rx_buffer_fetch_cb);
#ifdef ESP_AT_FW_VERSION
if ((ESP_AT_FW_VERSION != NULL) && (os_strlen(ESP_AT_FW_VERSION) < 64)) {
os_sprintf(buf,"compile time:%s %s\r\n"ESP_AT_FW_VERSION,__DATE__,__TIME__);
} else {
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
}
#else
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
#endif
at_set_custom_info(buf);
at_fake_uart_enable(TRUE,at_sdio_response);

Expand Down

0 comments on commit c8255dd

Please sign in to comment.