Skip to content
Snippets Groups Projects
Commit b954b2b4 authored by Emilio Corigliano's avatar Emilio Corigliano
Browse files

[USART] fix for the read of data with serial. PIPELINE FAIL: the miosix lib...

[USART] fix for the read of data with serial. PIPELINE FAIL: the miosix lib isn't updated with the commented interrupts handlers for the usart in serial_stm32
parent 728ac130
Branches
Tags
No related merge requests found
......@@ -202,6 +202,8 @@ void USART::init()
NVIC_EnableIRQ(USART1_IRQn);
u1tx::getPin().mode(miosix::Mode::ALTERNATE); // check 1
u1rx::getPin().mode(miosix::Mode::ALTERNATE); // check 4
u1tx::alternateFunction(7);
u1rx::alternateFunction(7);
break;
case 2:
NVIC_SetPriority(USART2_IRQn,
......@@ -209,6 +211,8 @@ void USART::init()
NVIC_EnableIRQ(USART2_IRQn);
u2tx::getPin().mode(miosix::Mode::ALTERNATE);
u2rx::getPin().mode(miosix::Mode::ALTERNATE);
u2tx::alternateFunction(7);
u2rx::alternateFunction(7);
break;
case 3:
NVIC_SetPriority(USART3_IRQn,
......@@ -216,6 +220,8 @@ void USART::init()
NVIC_EnableIRQ(USART3_IRQn);
u3tx::getPin().mode(miosix::Mode::ALTERNATE);
u3rx::getPin().mode(miosix::Mode::ALTERNATE);
u3tx::alternateFunction(7);
u3rx::alternateFunction(7);
break;
}
......
......@@ -45,7 +45,8 @@ int main()
while (true)
{
printf("%d\n", usart1.read(buf, 32));
if (usart1.read(buf, 32) > 0)
printf("%s\n", buf);
Thread::sleep(1000);
Thread::sleep(1000);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment