refactoring meterbus
This commit is contained in:
		| @@ -251,6 +251,16 @@ static void parseAndPrintFrame() { | |||||||
| void mbusCommISR() { | void mbusCommISR() { | ||||||
| //     coloredMsg(LOG_RED, false, "mbc isr"); | //     coloredMsg(LOG_RED, false, "mbc isr"); | ||||||
|     show(DEBUG_1, TOGGLE); |     show(DEBUG_1, TOGGLE); | ||||||
|  |  | ||||||
|  |     uint32_t isrflags   = READ_REG(mbusUart.Instance->SR); | ||||||
|  |     uint32_t cr1its     = READ_REG(mbusUart.Instance->CR1); | ||||||
|  |     uint32_t cr3its     = READ_REG(mbusUart.Instance->CR3); | ||||||
|  |  | ||||||
|  |     if (((isrflags & USART_SR_RXNE) != RESET) && ((cr1its & USART_CR1_RXNEIE) != RESET)) { | ||||||
|  |         uint8_t data = (uint8_t)(mbusUart.Instance->DR & (uint8_t)0x00FF); | ||||||
|  |  | ||||||
|  |         return; | ||||||
|  |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| void mbusCommExec() { | void mbusCommExec() { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user