Skip to content

Commit

Permalink
Revert "Rework of WireProtocol (nanoframework#1884)" (nanoframework#1897
Browse files Browse the repository at this point in the history
)
  • Loading branch information
josesimoes committed Aug 25, 2021
1 parent 83d0612 commit 7b3b15d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
9 changes: 6 additions & 3 deletions targets/ChibiOS/_common/WireProtocol_ReceiverThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <cmsis_os.h>
#include <WireProtocol_Message.h>

extern WP_Message inboundMessage;

#if (HAL_USE_SERIAL_USB == TRUE)
extern SerialUSBDriver SDU1;
#endif
Expand All @@ -21,8 +23,6 @@ __attribute__((noreturn)) void ReceiverThread(void const *argument)

osDelay(500);

WP_Message_PrepareReception();

// loop until thread receives a request to terminate
while (1)
{
Expand All @@ -33,7 +33,10 @@ __attribute__((noreturn)) void ReceiverThread(void const *argument)
{
#endif

WP_Message_Process();
WP_Message_Initialize(&inboundMessage);
WP_Message_PrepareReception(&inboundMessage);

WP_Message_Process(&inboundMessage);

#if (HAL_USE_SERIAL_USB == TRUE)
// pass control to the OS
Expand Down
2 changes: 0 additions & 2 deletions targets/FreeRTOS/_common/WireProtocol_ReceiverThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ void ReceiverThread(void *argument)
{
(void)argument;

WP_Message_PrepareReception();

// loop forever
while (1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ void ReceiverThread(void const *argument)
{
(void)argument;

WP_Message_PrepareReception();

// loop forever
while (1)
{
Expand Down
7 changes: 4 additions & 3 deletions targets/TI_SimpleLink/_common/WireProtocol_ReceiverThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ void ReceiverThread(UArg arg0, UArg arg1)
(void)arg0;
(void)arg1;

WP_Message_PrepareReception();

// loop forever
while (1)
{
WP_Message_Process();
WP_Message_Initialize(&inboundMessage);
WP_Message_PrepareReception(&inboundMessage);

WP_Message_Process(&inboundMessage);

// Allow other tasks a chance to run
Task_yield();
Expand Down

0 comments on commit 7b3b15d

Please sign in to comment.