Skip to content

Commit 1caa67b

Browse files
authored
[drivewire][bus] fix OP_TIME return value. (FujiNetWIFI#992)
1 parent 7b35a41 commit 1caa67b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

lib/bus/drivewire/drivewire.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void systemBus::op_time()
312312

313313
Debug_printf("Returning %02d/%02d/%02d %02d:%02d:%02d\n", now->tm_year, now->tm_mon, now->tm_mday, now->tm_hour, now->tm_min, now->tm_sec);
314314

315-
fnDwCom.write(now->tm_year - 1900);
315+
fnDwCom.write(now->tm_year);
316316
fnDwCom.write(now->tm_mon);
317317
fnDwCom.write(now->tm_mday);
318318
fnDwCom.write(now->tm_hour);
@@ -345,7 +345,7 @@ void systemBus::op_dwinit()
345345
fnDwCom.write(0x04);
346346
#else
347347
fnDwCom.write(DWINIT_FEATURES);
348-
#endif
348+
#endif
349349
}
350350

351351
void systemBus::op_getstat()
@@ -382,7 +382,7 @@ void systemBus::op_serread()
382382
unsigned char vchan = 0;
383383
unsigned char response = 0x00;
384384

385-
// scan client channels for first that has available data
385+
// scan client channels for first that has available data
386386
for (int i = 0; i < 16; i++) {
387387
if (outgoingChannel[i].empty() == false) {
388388
response = outgoingChannel[i].front();
@@ -391,7 +391,7 @@ void systemBus::op_serread()
391391
break;
392392
}
393393
}
394-
394+
395395
fnDwCom.write(vchan);
396396
fnDwCom.write(response);
397397

@@ -402,8 +402,8 @@ void systemBus::op_serreadm()
402402
{
403403
unsigned char vchan = fnDwCom.read();
404404
unsigned char count = fnDwCom.read();
405-
406-
// scan client channels for first that has available data
405+
406+
// scan client channels for first that has available data
407407
for (vchan = 0; vchan < 16; vchan++) {
408408
if (outgoingChannel[vchan].empty() == false) {
409409
if (outgoingChannel[vchan].size() < count) count = outgoingChannel[vchan].size();
@@ -433,7 +433,7 @@ void systemBus::op_serwritem()
433433
vchan = fnDwCom.read();
434434
fnDwCom.read(); // discard
435435
count = fnDwCom.read();
436-
436+
437437
for (int i = 0; i < count; i++) {
438438
int byte = fnDwCom.read();
439439
incomingChannel[vchan].push(byte);
@@ -468,8 +468,8 @@ void systemBus::_drivewire_process_cmd()
468468
{
469469
case OP_JEFF:
470470
op_jeff();
471-
break;
472-
case OP_NOP:
471+
break;
472+
case OP_NOP:
473473
op_nop();
474474
break;
475475
case OP_RESET1:
@@ -545,7 +545,7 @@ void systemBus::_drivewire_process_cmd()
545545
break;
546546
}
547547
}
548-
548+
549549
fnLedManager.set(eLed::LED_BUS, false);
550550
}
551551

@@ -608,23 +608,23 @@ void systemBus::setup()
608608
#ifdef CONFIG_IDF_TARGET_ESP32S3
609609
// Configure UART to RP2040
610610
#ifdef FORCE_UART_BAUD
611-
Debug_printv("FORCE_UART_BAUD set to %u", FORCE_UART_BAUD);
612-
_drivewireBaud = FORCE_UART_BAUD;
611+
Debug_printv("FORCE_UART_BAUD set to %u", FORCE_UART_BAUD);
612+
_drivewireBaud = FORCE_UART_BAUD;
613613
#else
614-
_drivewireBaud = 115200;
614+
_drivewireBaud = 115200;
615615
#endif
616616

617617
#else
618-
// Setup interrupt for cassette motor pin
619-
gpio_config_t io_conf = {
620-
.pin_bit_mask = (1ULL << PIN_CASS_MOTOR), // bit mask of the pins that you want to set
618+
// Setup interrupt for cassette motor pin
619+
gpio_config_t io_conf = {
620+
.pin_bit_mask = (1ULL << PIN_CASS_MOTOR), // bit mask of the pins that you want to set
621621
.mode = GPIO_MODE_INPUT, // set as input mode
622622
.pull_up_en = GPIO_PULLUP_DISABLE, // disable pull-up mode
623623
.pull_down_en = GPIO_PULLDOWN_ENABLE, // enable pull-down mode
624624
.intr_type = GPIO_INTR_POSEDGE // interrupt on positive edge
625-
};
625+
};
626626

627-
_cassetteDev = new drivewireCassette();
627+
_cassetteDev = new drivewireCassette();
628628

629629
// configure GPIO with the given settings
630630
gpio_config(&io_conf);
@@ -682,7 +682,7 @@ void systemBus::setup()
682682
fnDwCom.flush_input();
683683
Debug_printv("DRIVEWIRE MODE");
684684

685-
// jeff hack to see if the S3 is getting serial data
685+
// jeff hack to see if the S3 is getting serial data
686686
// Debug_println("now receiving data...");
687687
// uint8_t b[] = {' '};
688688
// while(1)

0 commit comments

Comments
 (0)