Skip to content
Snippets Groups Projects
Commit 6e428319 authored by Davide Mor's avatar Davide Mor
Browse files

[sx1278] Pushed temporary serial fix

parent fb14f9df
Branches
No related tags found
No related merge requests found
...@@ -77,15 +77,13 @@ void initBoard() ...@@ -77,15 +77,13 @@ void initBoard()
void recvLoop() void recvLoop()
{ {
uint8_t msg[256]; uint8_t msg[256];
auto console = miosix::DefaultConsole::instance().get();
while (1) while (1)
{ {
int len = sx1278->receive(msg, sizeof(msg)); int len = sx1278->receive(msg, sizeof(msg));
if (len > 0) if (len > 0)
{ {
console->writeBlock(msg, len, 0); auto serial = miosix::DefaultConsole::instance().get();
// TODO: Flushing? serial->writeBlock(msg, len, 0);
} }
} }
} }
...@@ -93,11 +91,10 @@ void recvLoop() ...@@ -93,11 +91,10 @@ void recvLoop()
void sendLoop() void sendLoop()
{ {
uint8_t msg[256]; uint8_t msg[256];
auto console = miosix::DefaultConsole::instance().get();
while (1) while (1)
{ {
int len = console->readBlock(msg, sizeof(msg), 0); auto serial = miosix::DefaultConsole::instance().get();
int len = serial->readBlock(msg, sizeof(msg), 0);
if (len > 0) if (len > 0)
{ {
sx1278->send(msg, len); sx1278->send(msg, len);
...@@ -127,8 +124,10 @@ int main() ...@@ -127,8 +124,10 @@ int main()
printf("\n[sx1278] Initialization complete!\n"); printf("\n[sx1278] Initialization complete!\n");
while (1) // God please forgive me
miosix::Thread::wait(); // FIXME(davide.mor): ABSOLUTELY fix this
miosix::Thread::sleep(10000);
miosix::reboot();
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment