Skip to content

Commit

Permalink
UARTClass::write simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jul 13, 2019
1 parent 56f7f84 commit ed6d4b3
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/eez/apps/psu/stm32/serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,8 @@ void UARTClass::end() {
}

int UARTClass::write(const char *buffer, int size) {
for (int i = 0; i < 10; ++i) {

#ifdef STM32F429xx
uint8_t result = CDC_Transmit_HS((uint8_t *)buffer, (uint16_t)size);
#endif

#ifdef STM32F769xx
uint8_t result = CDC_Transmit_FS((uint8_t *)buffer, (uint16_t)size);
#endif

if (result != USBD_BUSY) {
return size;
}

osDelay(1);
}

return 0;
CDC_Transmit_FS((uint8_t *)buffer, (uint16_t)size);
return size;
}

int UARTClass::print(const char *data) {
Expand Down

0 comments on commit ed6d4b3

Please sign in to comment.