comparison Discovery/Src/tComm.c @ 398:2d980f765034 ImproveBluetooth

Bugfix: Merge / cleanup problem: wrong variable used for receiption
author ideenmodellierer
date Mon, 02 Dec 2019 22:03:05 +0100
parents effa6fb9eb89
children 523892f62ce0
comparison
equal deleted inserted replaced
397:1db721dda682 398:2d980f765034
532 answer = prompt4D4C(receiveStartByteUart); 532 answer = prompt4D4C(receiveStartByteUart);
533 } 533 }
534 534
535 while((answer == prompt4D4C(receiveStartByteUart)) && (timeoutCounter < UART_TIMEOUT_SECONDS)) /* try receive once a second */ 535 while((answer == prompt4D4C(receiveStartByteUart)) && (timeoutCounter < UART_TIMEOUT_SECONDS)) /* try receive once a second */
536 { 536 {
537 if(HAL_UART_Receive(&UartHandle, (uint8_t*)&aRxByte, 1, 1000)!= HAL_OK) 537 if(HAL_UART_Receive(&UartHandle, (uint8_t*)&localRx, 1, 1000)!= HAL_OK)
538 { 538 {
539 timeoutCounter++; 539 timeoutCounter++;
540 get_globalStateList(&status); 540 get_globalStateList(&status);
541 if (status.base != BaseComm) 541 if (status.base != BaseComm)
542 { 542 {
589 aTxBuffer[1] = prompt4D4C(receiveStartByteUart); 589 aTxBuffer[1] = prompt4D4C(receiveStartByteUart);
590 uint8_t tempHigh, tempLow; 590 uint8_t tempHigh, tempLow;
591 count = 0; 591 count = 0;
592 592
593 // Ignore communication on Text like RING, CONNECT, 593 // Ignore communication on Text like RING, CONNECT,
594 if(type < 0x60) return prompt4D4C(receiveStartByteUart); 594 if(type == 0xFF) return 0;
595 595 if(type < 0x60)
596 {
597 return prompt4D4C(receiveStartByteUart);
598 }
596 // service mode only commands 599 // service mode only commands
597 if(receiveStartByteUart == BYTE_SERVICE_MODE) 600 if(receiveStartByteUart == BYTE_SERVICE_MODE)
598 { 601 {
599 // first part 602 // first part
600 switch(type) 603 switch(type)
630 uint8_t logStepBackwards = 0; 633 uint8_t logStepBackwards = 0;
631 convert16_Type totalDiveCount; 634 convert16_Type totalDiveCount;
632 logCopyDataLength.u32bit = 0; 635 logCopyDataLength.u32bit = 0;
633 totalDiveCount.u16bit = 0; 636 totalDiveCount.u16bit = 0;
634 #endif 637 #endif
635 // Exit communication on 0xFF command
636 if(type == 0xFF) return 0;
637 638
638 // return of command for (almost) all commands 639 // return of command for (almost) all commands
639 switch(type) 640 switch(type)
640 { 641 {
641 // not supported yet case 0x20: // send hi:lo:temp1 bytes starting from ext_flash_address:3 642 // not supported yet case 0x20: // send hi:lo:temp1 bytes starting from ext_flash_address:3