refactor device value rendering (to Web, Console or MQTT) to base class #632

This commit is contained in:
proddy
2020-12-13 22:52:34 +01:00
parent f72e549850
commit ffa313ebe4
60 changed files with 2579 additions and 3367 deletions

View File

@@ -186,6 +186,9 @@ uint16_t EMSuart::transmit(const uint8_t * buf, const uint8_t len) {
if (len == 0 || len >= EMS_MAXBUFFERSIZE) {
return EMS_TX_STATUS_ERR;
}
if (tx_mode_ == 0) {
return EMS_TX_STATUS_OK;
}
if (tx_mode_ > 5) { // timer controlled modes
for (uint8_t i = 0; i < len; i++) {

View File

@@ -41,7 +41,6 @@ bool EMSuart::sending_ = false;
// Important: must not use ICACHE_FLASH_ATTR
//
void ICACHE_RAM_ATTR EMSuart::emsuart_rx_intr_handler(void * para) {
if (USIS(EMSUART_UART) & ((1 << UIBD))) { // BREAK detection = End of EMS data block
USC0(EMSUART_UART) &= ~(1 << UCBRK); // reset tx-brk
if (sending_) { // irq tx_mode is interrupted by <brk>, should never happen
@@ -233,6 +232,9 @@ uint16_t ICACHE_FLASH_ATTR EMSuart::transmit(uint8_t * buf, uint8_t len) {
if (len == 0 || len >= EMS_MAXBUFFERSIZE) {
return EMS_TX_STATUS_ERR; // nothing or to much to send
}
if (tx_mode_ == 0) {
return EMS_TX_STATUS_OK;
}
// timer controlled modes with extra delay
if (tx_mode_ >= 5) {