diff --git a/examples/freertos/FreeRTOSConfig.h b/examples/freertos/FreeRTOSConfig.h index 49a74915..6b521a6a 100644 --- a/examples/freertos/FreeRTOSConfig.h +++ b/examples/freertos/FreeRTOSConfig.h @@ -108,9 +108,14 @@ to exclude the API function. */ header file. */ void vApplicationMallocFailedHook(void); void vAssertCalled(void); -#define configASSERT(x) \ - if ((x) == 0) \ - vAssertCalled() +#define configASSERT(x) \ + if ((x) == 0) { \ + printf("file [%s]\r\n", __FILE__); \ + printf("func [%s]\r\n", __FUNCTION__); \ + printf("line [%d]\r\n", __LINE__); \ + printf("%s\r\n", (const char *)(#x)); \ + vAssertCalled(); \ + } #if (configUSE_TICKLESS_IDLE != 0) void vApplicationSleep(uint32_t xExpectedIdleTime); diff --git a/examples/peripherals/emac/lwip_http_server/FreeRTOSConfig.h b/examples/peripherals/emac/lwip_http_server/FreeRTOSConfig.h index 164d8dd4..409ade00 100644 --- a/examples/peripherals/emac/lwip_http_server/FreeRTOSConfig.h +++ b/examples/peripherals/emac/lwip_http_server/FreeRTOSConfig.h @@ -108,9 +108,14 @@ to exclude the API function. */ header file. */ void vApplicationMallocFailedHook(void); void vAssertCalled(void); -#define configASSERT(x) \ - if ((x) == 0) \ - vAssertCalled() +#define configASSERT(x) \ + if ((x) == 0) { \ + printf("file [%s]\r\n", __FILE__); \ + printf("func [%s]\r\n", __FUNCTION__); \ + printf("line [%d]\r\n", __LINE__); \ + printf("%s\r\n", (const char *)(#x)); \ + vAssertCalled(); \ + } #if (configUSE_TICKLESS_IDLE != 0) void vApplicationSleep(uint32_t xExpectedIdleTime); diff --git a/examples/peripherals/emac/lwip_tcp/FreeRTOSConfig.h b/examples/peripherals/emac/lwip_tcp/FreeRTOSConfig.h index 164d8dd4..409ade00 100644 --- a/examples/peripherals/emac/lwip_tcp/FreeRTOSConfig.h +++ b/examples/peripherals/emac/lwip_tcp/FreeRTOSConfig.h @@ -108,9 +108,14 @@ to exclude the API function. */ header file. */ void vApplicationMallocFailedHook(void); void vAssertCalled(void); -#define configASSERT(x) \ - if ((x) == 0) \ - vAssertCalled() +#define configASSERT(x) \ + if ((x) == 0) { \ + printf("file [%s]\r\n", __FILE__); \ + printf("func [%s]\r\n", __FUNCTION__); \ + printf("line [%d]\r\n", __LINE__); \ + printf("%s\r\n", (const char *)(#x)); \ + vAssertCalled(); \ + } #if (configUSE_TICKLESS_IDLE != 0) void vApplicationSleep(uint32_t xExpectedIdleTime); diff --git a/examples/peripherals/emac/lwip_tcp/tcp_client.c b/examples/peripherals/emac/lwip_tcp/tcp_client.c index 560ec5dd..0689c56b 100644 --- a/examples/peripherals/emac/lwip_tcp/tcp_client.c +++ b/examples/peripherals/emac/lwip_tcp/tcp_client.c @@ -165,7 +165,7 @@ static void tcp_client_socket_test(void) printf("write falied!\r\n"); break; } - arch_delay_us(100); + bflb_mtimer_delay_us(100); total_cnt += sizeof(send_buf); } printf("Total send data=0x%08lx%08lx\r\n", diff --git a/examples/peripherals/emac/lwip_tcp/tcp_server.c b/examples/peripherals/emac/lwip_tcp/tcp_server.c index 1792d436..46cc0341 100644 --- a/examples/peripherals/emac/lwip_tcp/tcp_server.c +++ b/examples/peripherals/emac/lwip_tcp/tcp_server.c @@ -226,6 +226,15 @@ static void tcp_server_socket_thread(void *arg) int sock, newconn, size; struct sockaddr_in address, remotehost; + tmpnetif = netif_find("bl"); + +#if LWIP_DHCP + while (tmpnetif->state != 3) { + printf("wait DHCP get ip...\r\n"); + vTaskDelay(1000); + } +#endif + printf("TCP Server create socket\r\n"); /* create a TCP socket */ @@ -246,7 +255,6 @@ static void tcp_server_socket_thread(void *arg) /* listen for incoming connections (TCP listen backlog = 5) */ listen(sock, 5); - tmpnetif = netif_find("bl"); sprintf((char *)iptxt, "%s", ip4addr_ntoa(&tmpnetif->ip_addr)); printf("Create server success, server ip & listen port:%s:%d\r\n", iptxt, TCP_SERVER_TEST_PORT); diff --git a/examples/peripherals/emac/lwip_udp/FreeRTOSConfig.h b/examples/peripherals/emac/lwip_udp/FreeRTOSConfig.h index 164d8dd4..409ade00 100644 --- a/examples/peripherals/emac/lwip_udp/FreeRTOSConfig.h +++ b/examples/peripherals/emac/lwip_udp/FreeRTOSConfig.h @@ -108,9 +108,14 @@ to exclude the API function. */ header file. */ void vApplicationMallocFailedHook(void); void vAssertCalled(void); -#define configASSERT(x) \ - if ((x) == 0) \ - vAssertCalled() +#define configASSERT(x) \ + if ((x) == 0) { \ + printf("file [%s]\r\n", __FILE__); \ + printf("func [%s]\r\n", __FUNCTION__); \ + printf("line [%d]\r\n", __LINE__); \ + printf("%s\r\n", (const char *)(#x)); \ + vAssertCalled(); \ + } #if (configUSE_TICKLESS_IDLE != 0) void vApplicationSleep(uint32_t xExpectedIdleTime); diff --git a/examples/peripherals/usbhost/FreeRTOSConfig.h b/examples/peripherals/usbhost/FreeRTOSConfig.h index 49a74915..6b521a6a 100644 --- a/examples/peripherals/usbhost/FreeRTOSConfig.h +++ b/examples/peripherals/usbhost/FreeRTOSConfig.h @@ -108,9 +108,14 @@ to exclude the API function. */ header file. */ void vApplicationMallocFailedHook(void); void vAssertCalled(void); -#define configASSERT(x) \ - if ((x) == 0) \ - vAssertCalled() +#define configASSERT(x) \ + if ((x) == 0) { \ + printf("file [%s]\r\n", __FILE__); \ + printf("func [%s]\r\n", __FUNCTION__); \ + printf("line [%d]\r\n", __LINE__); \ + printf("%s\r\n", (const char *)(#x)); \ + vAssertCalled(); \ + } #if (configUSE_TICKLESS_IDLE != 0) void vApplicationSleep(uint32_t xExpectedIdleTime);