Skip to content

Commit

Permalink
Remove unused code from nanoBooter main (#730)
Browse files Browse the repository at this point in the history
  • Loading branch information
josesimoes authored Jun 6, 2018
1 parent 8f0000c commit f0e1467
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 35 deletions.
8 changes: 3 additions & 5 deletions targets/CMSIS-OS/ChibiOS/MBN_QUAIL/nanoBooter/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <usbcfg.h>
#include <targetHAL.h>
#include <WireProtocol_ReceiverThread.h>
#include <nanoPAL_BlockStorage.h>
#include <LaunchCLR.h>

void BlinkerThread(void const * argument)
Expand Down Expand Up @@ -39,9 +40,6 @@ osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
// Application entry point.
int main(void) {

osThreadId blinkerThreadId;
osThreadId receiverThreadId;

// HAL initialization, this also initializes the configured device drivers
// and performs the board-specific initializations.
halInit();
Expand Down Expand Up @@ -70,10 +68,10 @@ int main(void) {
usbConnectBus(serusbcfg.usbp);

// Creates the blinker thread, it does not start immediately.
blinkerThreadId = osThreadCreate(osThread(BlinkerThread), NULL);
osThreadCreate(osThread(BlinkerThread), NULL);

// create the receiver thread
receiverThreadId = osThreadCreate(osThread(ReceiverThread), NULL);
osThreadCreate(osThread(ReceiverThread), NULL);

// start kernel, after this main() will behave like a thread with priority osPriorityNormal
osKernelStart();
Expand Down
8 changes: 3 additions & 5 deletions targets/CMSIS-OS/ChibiOS/NETDUINO3_WIFI/nanoBooter/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <usbcfg.h>
#include <targetHAL.h>
#include <WireProtocol_ReceiverThread.h>
#include <nanoPAL_BlockStorage.h>
#include <LaunchCLR.h>

void BlinkerThread(void const * argument)
Expand Down Expand Up @@ -48,9 +49,6 @@ osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
// Application entry point.
int main(void) {

osThreadId blinkerThreadId;
osThreadId receiverThreadId;

// HAL initialization, this also initializes the configured device drivers
// and performs the board-specific initializations.
halInit();
Expand Down Expand Up @@ -79,10 +77,10 @@ int main(void) {
usbConnectBus(serusbcfg.usbp);

// Creates the blinker thread, it does not start immediately.
blinkerThreadId = osThreadCreate(osThread(BlinkerThread), NULL);
osThreadCreate(osThread(BlinkerThread), NULL);

// create the receiver thread
receiverThreadId = osThreadCreate(osThread(ReceiverThread), NULL);
osThreadCreate(osThread(ReceiverThread), NULL);

// start kernel, after this main() will behave like a thread with priority osPriorityNormal
osKernelStart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <swo.h>
#include <targetHAL.h>
#include <WireProtocol_ReceiverThread.h>
#include <nanoPAL_BlockStorage.h>
#include <LaunchCLR.h>

void BlinkerThread(void const * argument)
Expand All @@ -35,9 +36,6 @@ osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
// Application entry point.
int main(void) {

osThreadId blinkerThreadId;
osThreadId receiverThreadId;

// HAL initialization, this also initializes the configured device drivers
// and performs the board-specific initializations.
halInit();
Expand Down Expand Up @@ -81,10 +79,10 @@ int main(void) {
usbConnectBus(serusbcfg.usbp);

// Creates the blinker thread, it does not start immediately.
blinkerThreadId = osThreadCreate(osThread(BlinkerThread), NULL);
osThreadCreate(osThread(BlinkerThread), NULL);

// create the receiver thread
receiverThreadId = osThreadCreate(osThread(ReceiverThread), NULL);
osThreadCreate(osThread(ReceiverThread), NULL);

// start kernel, after this main() will behave like a thread with priority osPriorityNormal
osKernelStart();
Expand Down
8 changes: 3 additions & 5 deletions targets/CMSIS-OS/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <swo.h>
#include <targetHAL.h>
#include <WireProtocol_ReceiverThread.h>
#include <nanoPAL_BlockStorage.h>
#include <LaunchCLR.h>

void BlinkerThread(void const * argument)
Expand All @@ -33,9 +34,6 @@ osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
// Application entry point.
int main(void) {

osThreadId blinkerThreadId;
osThreadId receiverThreadId;

// HAL initialization, this also initializes the configured device drivers
// and performs the board-specific initializations.
halInit();
Expand Down Expand Up @@ -71,10 +69,10 @@ int main(void) {
palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(1)); // USART2 RX

// Creates the blinker thread, it does not start immediately.
blinkerThreadId = osThreadCreate(osThread(BlinkerThread), NULL);
osThreadCreate(osThread(BlinkerThread), NULL);

// create the receiver thread
receiverThreadId = osThreadCreate(osThread(ReceiverThread), NULL);
osThreadCreate(osThread(ReceiverThread), NULL);

// start kernel, after this main() will behave like a thread with priority osPriorityNormal
osKernelStart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <swo.h>
#include <targetHAL.h>
#include <WireProtocol_ReceiverThread.h>
#include <nanoPAL_BlockStorage.h>
#include <LaunchCLR.h>

void BlinkerThread(void const * argument)
Expand All @@ -35,9 +36,6 @@ osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
// Application entry point.
int main(void) {

osThreadId blinkerThreadId;
osThreadId receiverThreadId;

// HAL initialization, this also initializes the configured device drivers
// and performs the board-specific initializations.
halInit();
Expand Down Expand Up @@ -80,10 +78,10 @@ int main(void) {
usbConnectBus(serusbcfg.usbp);

// Creates the blinker thread, it does not start immediately.
blinkerThreadId = osThreadCreate(osThread(BlinkerThread), NULL);
osThreadCreate(osThread(BlinkerThread), NULL);

// create the receiver thread
receiverThreadId = osThreadCreate(osThread(ReceiverThread), NULL);
osThreadCreate(osThread(ReceiverThread), NULL);

// start kernel, after this main() will behave like a thread with priority osPriorityNormal
osKernelStart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <swo.h>
#include <targetHAL.h>
#include <WireProtocol_ReceiverThread.h>
#include <nanoPAL_BlockStorage.h>
#include <LaunchCLR.h>

void BlinkerThread(void const * argument)
Expand All @@ -36,9 +37,6 @@ osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
// Application entry point.
int main(void) {

osThreadId blinkerThreadId;
osThreadId receiverThreadId;

// HAL initialization, this also initializes the configured device drivers
// and performs the board-specific initializations.
halInit();
Expand Down Expand Up @@ -81,10 +79,10 @@ int main(void) {
usbConnectBus(serusbcfg.usbp);

// Creates the blinker thread, it does not start immediately.
blinkerThreadId = osThreadCreate(osThread(BlinkerThread), NULL);
osThreadCreate(osThread(BlinkerThread), NULL);

// create the receiver thread
receiverThreadId = osThreadCreate(osThread(ReceiverThread), NULL);
osThreadCreate(osThread(ReceiverThread), NULL);

// start kernel, after this main() will behave like a thread with priority osPriorityNormal
osKernelStart();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <swo.h>
#include <targetHAL.h>
#include <WireProtocol_ReceiverThread.h>
#include <nanoPAL_BlockStorage.h>
#include <LaunchCLR.h>

void BlinkerThread(void const * argument)
Expand All @@ -35,9 +36,6 @@ osThreadDef(ReceiverThread, osPriorityHigh, 3072, "ReceiverThread");
// Application entry point.
int main(void) {

osThreadId blinkerThreadId;
osThreadId receiverThreadId;

// HAL initialization, this also initializes the configured device drivers
// and performs the board-specific initializations.
halInit();
Expand Down Expand Up @@ -81,10 +79,10 @@ int main(void) {
usbConnectBus(serusbcfg.usbp);

// Creates the blinker thread, it does not start immediately.
blinkerThreadId = osThreadCreate(osThread(BlinkerThread), NULL);
osThreadCreate(osThread(BlinkerThread), NULL);

// create the receiver thread
receiverThreadId = osThreadCreate(osThread(ReceiverThread), NULL);
osThreadCreate(osThread(ReceiverThread), NULL);

// start kernel, after this main() will behave like a thread with priority osPriorityNormal
osKernelStart();
Expand Down

0 comments on commit f0e1467

Please sign in to comment.