analogSequence repaired
This commit is contained in:
parent
ff84de538a
commit
bff5ff42e9
85 changed files with 1180 additions and 287 deletions
|
@ -72,6 +72,15 @@ void USART::flushOutputBuffer()
|
|||
throw USARTException("Fehler beim Versenden des Ausgangspuffers");
|
||||
}
|
||||
|
||||
void USART::transmit(uint8_t *buffer, uint16_t offset, uint8_t len)
|
||||
{
|
||||
int code = write(file_desc, buffer + offset, len);
|
||||
if (code != len)
|
||||
throw USARTException(
|
||||
std::string(__FUNCTION__) + " failed: " + std::string(__FILE__) + "#" + std::to_string(__LINE__) +
|
||||
", " + strerror(code) + " (code " + std::to_string(code) + " / " + std::to_string(len) + ")");
|
||||
}
|
||||
|
||||
void USART::receive(uint8_t *buffer, uint16_t offset, uint8_t len)
|
||||
{
|
||||
int bytes_avail, code;
|
||||
|
@ -102,13 +111,11 @@ void USART::receive(uint8_t *buffer, uint16_t offset, uint8_t len)
|
|||
", " + strerror(code) + " (code " + std::to_string(code) + " / " + std::to_string(len) + ")");
|
||||
}
|
||||
|
||||
void USART::transmit(uint8_t *buffer, uint16_t offset, uint8_t len)
|
||||
void USART::drop(uint8_t len)
|
||||
{
|
||||
int code = write(file_desc, buffer + offset, len);
|
||||
if (code != len)
|
||||
throw USARTException(
|
||||
std::string(__FUNCTION__) + " failed: " + std::string(__FILE__) + "#" + std::to_string(__LINE__) +
|
||||
", " + strerror(code) + " (code " + std::to_string(code) + " / " + std::to_string(len) + ")");
|
||||
// Kann bestimmt noch eleganter gelöst werden
|
||||
uint8_t dummy[len];
|
||||
receive(&dummy[0], 0, len);
|
||||
}
|
||||
|
||||
uint32_t USART::getBaudrate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue