@@ -119,6 +119,19 @@ void eth_log(EthWorkerProcess process, const char* format, ...) {
119
119
furi_string_free (fstring );
120
120
}
121
121
122
+ void eth_printf (const char * format , ...) {
123
+ furi_assert (static_worker );
124
+ va_list args ;
125
+ va_start (args , format );
126
+ FuriString * fstring = furi_string_alloc_vprintf (format , args );
127
+ const char * string = furi_string_get_cstr (fstring );
128
+ va_end (args );
129
+
130
+ FURI_LOG_I (TAG , "%s" , string );
131
+ //ehternet_save_process_print(static_worker->config, string);
132
+ furi_string_free (fstring );
133
+ }
134
+
122
135
static void eth_set_force_state (EthWorkerState state ) {
123
136
EthWorker * worker = static_worker ;
124
137
furi_assert (worker );
@@ -338,7 +351,7 @@ int32_t eth_worker_task(void* context) {
338
351
339
352
furi_hal_spi_acquire (& furi_hal_spi_bus_handle_external );
340
353
uint8_t W5500FifoSize [2 ][8 ] = {{2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 }, {2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 }};
341
- uint8_t dhcp_buffer [2000 ];
354
+ uint8_t dhcp_buffer [2048 ];
342
355
343
356
reg_wizchip_spi_cbfunc (W5500_ReadByte , W5500_WriteByte );
344
357
reg_wizchip_spiburst_cbfunc (W5500_ReadBuff , W5500_WriteBuff );
@@ -417,8 +430,14 @@ int32_t eth_worker_task(void* context) {
417
430
}
418
431
reg_dhcp_cbfunc (Callback_IPAssigned , Callback_IPAssigned , Callback_IPConflict );
419
432
DHCP_init (DHCP_SOCKET , dhcp_buffer );
433
+ {
434
+ // DHCP_run();
435
+ // eth_log(EthWorkerProcessDHCP, "DHCP Send Discover");
436
+ // furi_delay_ms(1000);
437
+ // DHCP_stop();
438
+ }
420
439
uint8_t next_cycle = 1 ;
421
- uint8_t divider = 0 ;
440
+ uint16_t divider = 0 ;
422
441
while (next_cycle && worker -> state == EthWorkerStateDHCP ) {
423
442
uint8_t dhcp_ret = DHCP_run ();
424
443
switch (dhcp_ret ) {
@@ -438,10 +457,10 @@ int32_t eth_worker_task(void* context) {
438
457
eth_log (EthWorkerProcessDHCP , "DHCP Failed" );
439
458
break ;
440
459
}
441
- furi_delay_ms (100 );
442
- if (divider ++ % 10 == 0 ) {
443
- eth_log (EthWorkerProcessDHCP , "DHCP process %d" , divider / 10 );
444
- if (divider > 250 ) {
460
+ furi_delay_ms (10 );
461
+ if (divider ++ % 100 == 0 ) {
462
+ eth_log (EthWorkerProcessDHCP , "DHCP process %d" , divider / 100 );
463
+ if (divider > 400 ) {
445
464
DHCP_stop ();
446
465
eth_log (EthWorkerProcessDHCP , "DHCP Stop by timer" );
447
466
eth_set_force_state (EthWorkerStateInited );
0 commit comments