Advertisement
GeeckoDev

msp430 led

Dec 24th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. #include <msp430.h>
  2. #include "HAL.h"
  3. #include "BTPSKRNL.h"
  4.  
  5. static void WorkerFunction(void *param) {
  6.     HAL_ConsoleWrite(12, "hello world\n");
  7. }
  8.  
  9. static void IdleFunction(void *param) {
  10.     HAL_LedToggle(0);
  11. }
  12.  
  13. void MainThread(void) {
  14.     BTPS_Initialization_t btps_init;
  15.  
  16.     btps_init.GetTickCountCallback = HAL_GetTickCount;
  17.  
  18.     BTPS_Init(&btps_init);
  19.  
  20.     BTPS_AddFunctionToScheduler(WorkerFunction, NULL, 200);
  21.     BTPS_AddFunctionToScheduler(IdleFunction, NULL, 1000);
  22.  
  23.     BTPS_ExecuteScheduler();
  24. }
  25.  
  26. int main(void) {
  27.     WDTCTL = WDTPW | WDTHOLD;   // Stop watchdog timer
  28.    
  29.     HAL_ConfigureHardware();
  30.     __enable_interrupt();
  31.  
  32.     MainThread();
  33.  
  34.     return 1;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement