baud zero divide
This commit is contained in:
parent
47dd58d040
commit
4ec412bf43
1 changed files with 1 additions and 0 deletions
|
@ -69,6 +69,7 @@ uint32_t Usart::Down(const char * data, const uint32_t len) {
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
void Usart::SetBaud (const uint32_t _baud) const {
|
void Usart::SetBaud (const uint32_t _baud) const {
|
||||||
|
if (_baud == 0u) return; // ! zero divide
|
||||||
const ONE_BIT b = USART1.CTLR1.B.UE;
|
const ONE_BIT b = USART1.CTLR1.B.UE;
|
||||||
if (b == SET) USART1.CTLR1.B.UE = RESET;
|
if (b == SET) USART1.CTLR1.B.UE = RESET;
|
||||||
const uint32_t HCLK = SystemCoreClock; // hodiny pro USART zde nejsou děleny
|
const uint32_t HCLK = SystemCoreClock; // hodiny pro USART zde nejsou děleny
|
||||||
|
|
Loading…
Reference in a new issue