Skip to content

Commit c8255dd

Browse files
committed
feat(example): Add AT bin version
internal gitlab: 4fcb6dc5
1 parent b26fe7a commit c8255dd

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

examples/at/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ LDDIR = ../ld
3434

3535
CCFLAGS += -Os
3636

37+
ifdef ESP_AT_FW_VERSION
38+
CCFLAGS += -DESP_AT_FW_VERSION=\"$(ESP_AT_FW_VERSION)\"
39+
endif
40+
3741
TARGET_LDFLAGS = \
3842
-nostdlib \
3943
-Wl,-EL \

examples/at/user/user_main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,18 @@ user_rf_pre_init(void)
177177
void ICACHE_FLASH_ATTR
178178
user_init(void)
179179
{
180-
char buf[64] = {0};
180+
char buf[128] = {0};
181181
at_customLinkMax = 5;
182182
at_init();
183+
#ifdef ESP_AT_FW_VERSION
184+
if ((ESP_AT_FW_VERSION != NULL) && (os_strlen(ESP_AT_FW_VERSION) < 64)) {
185+
os_sprintf(buf,"compile time:%s %s\r\n"ESP_AT_FW_VERSION,__DATE__,__TIME__);
186+
} else {
187+
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
188+
}
189+
#else
183190
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
191+
#endif
184192
at_set_custom_info(buf);
185193
at_port_print("\r\nready\r\n");
186194
at_cmd_array_regist(&at_custom_cmd[0], sizeof(at_custom_cmd)/sizeof(at_custom_cmd[0]));

examples/at_sdio/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ LDDIR = ../ld
3535

3636
CCFLAGS += -Os
3737

38+
ifdef ESP_AT_FW_VERSION
39+
CCFLAGS += -DESP_AT_FW_VERSION=\"$(ESP_AT_FW_VERSION)\"
40+
endif
41+
3842
TARGET_LDFLAGS = \
3943
-nostdlib \
4044
-Wl,-EL \

examples/at_sdio/user/user_main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,21 @@ extern void at_custom_uart_rx_buffer_fetch_cb(void);
206206

207207
void ICACHE_FLASH_ATTR user_init(void)
208208
{
209-
char buf[64] = {0};
209+
char buf[128] = {0};
210210
at_customLinkMax = 5;
211211
sdio_slave_init();
212212
sdio_register_recv_cb(sdio_recv_data_callback);
213213
at_init();
214214
at_register_uart_rx_buffer_fetch_cb(at_custom_uart_rx_buffer_fetch_cb);
215+
#ifdef ESP_AT_FW_VERSION
216+
if ((ESP_AT_FW_VERSION != NULL) && (os_strlen(ESP_AT_FW_VERSION) < 64)) {
217+
os_sprintf(buf,"compile time:%s %s\r\n"ESP_AT_FW_VERSION,__DATE__,__TIME__);
218+
} else {
219+
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
220+
}
221+
#else
215222
os_sprintf(buf,"compile time:%s %s",__DATE__,__TIME__);
223+
#endif
216224
at_set_custom_info(buf);
217225
at_fake_uart_enable(TRUE,at_sdio_response);
218226

0 commit comments

Comments
 (0)