zhaohe 1 year ago
parent
commit
366d4edb32
  1. 3
      README.md
  2. 2
      usrc/project_configs.h
  3. 17
      usrc/service/network_service.c
  4. 2
      usrc/service/report_generator_service.c

3
README.md

@ -20,6 +20,9 @@ V3.3
1.修改dhcp启动的位置
2.修正网卡启动时,如果没有插网线,设备无法初始化的BUG
V3.3.1
1.修正网卡启动时,如果插着网线,获取不到IP的BUG
```
···

2
usrc/project_configs.h

@ -1,7 +1,7 @@
#pragma once
#define VERSION(main, sub, fix) (main << 16 | sub << 8 | fix << 0)
#define PC_VERSION VERSION(3, 3, 0)
#define PC_VERSION VERSION(3, 3, 1)
#define PC_MANUFACTURER0 ('i' | 'f' << 8 | 'l' << 16 | 'y' << 24)
#define PC_MANUFACTURER1 ('t' | 'o' << 8 | 'p' << 16 | '\0' << 24)

17
usrc/service/network_service.c

@ -149,14 +149,14 @@ void network_service_init() {
IP4_ADDR(&gw, GATEWAY_ADDRESS[0], GATEWAY_ADDRESS[1], GATEWAY_ADDRESS[2], GATEWAY_ADDRESS[3]);
netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);
netif_set_default(&gnetif);
netif_set_link_callback(&gnetif, ethernet_link_status_updated);
netif_set_status_callback(&gnetif, ethernet_status_updated);
netif_add_ext_callback(&extcb, netif_ext_callback);
if (netif_is_link_up(&gnetif)) {
netif_set_up(&gnetif);
} else {
netif_set_down(&gnetif);
}
netif_set_link_callback(&gnetif, ethernet_link_status_updated);
netif_set_status_callback(&gnetif, ethernet_status_updated);
netif_add_ext_callback(&extcb, netif_ext_callback);
osThreadDef(EthLink, ethernet_link_thread, NETWORK_REPORT_TASK_LEVEL, 0, 512);
osThreadCreate(osThread(EthLink), &gnetif);
} else {
@ -169,21 +169,18 @@ void network_service_init() {
netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &tcpip_input);
netif_set_default(&gnetif);
netif_set_link_callback(&gnetif, ethernet_link_status_updated);
netif_set_status_callback(&gnetif, ethernet_status_updated);
netif_add_ext_callback(&extcb, netif_ext_callback);
if (netif_is_link_up(&gnetif)) {
netif_set_up(&gnetif);
} else {
netif_set_down(&gnetif);
}
netif_set_link_callback(&gnetif, ethernet_link_status_updated);
netif_set_status_callback(&gnetif, ethernet_status_updated);
netif_add_ext_callback(&extcb, netif_ext_callback);
osThreadDef(EthLink, ethernet_link_thread, NETWORK_REPORT_TASK_LEVEL, 0, 1024);
osThreadCreate(osThread(EthLink), &gnetif);
// while (!netif_is_up(&gnetif)) {
// ZLOGI(TAG, "waiting for dhcp");
// osDelay(100);
// }
}
}

2
usrc/service/report_generator_service.c

@ -147,7 +147,7 @@ static void xync_signal_report_thread(void const *argument) {
uint32_t dtime = dtimes(&lasttimecode, &result, &newday);
lasttimecode = result;
ZLOGI(TAG, "timecode: %02d:%02d:%02d:%02d, frame: %d, dtime: %d", result.hour, result.minute, result.second, result.frame, cnt, dtime)
// ZLOGI(TAG, "timecode: %02d:%02d:%02d:%02d, frame: %d, dtime: %d", result.hour, result.minute, result.second, result.frame, cnt, dtime)
if (dtime <= 2) {
if (newday) {

Loading…
Cancel
Save