Skip to content
Snippets Groups Projects
Commit 5c0307b6 authored by Torben Petersen's avatar Torben Petersen
Browse files

Adds self calibration for telosb

parent 16b4eb02
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,15 @@ char send_thread_stack[1024+256];
char dump_thread_stack[512+256];
char send_thread_stack[512+256];
#endif
#ifdef BOARD_TELOSB
#include "board.h"
#include "stdio_uart.h"
extern void msp430_init_dco(void);
char calib_thread_stack[512+256];
#define CALIBRATION_SLEEP_TIME 1
#endif
//static msg_t dump_thread_msg_queue[RCV_QUEUE_SIZE];
//static msg_t send_thread_msg_queue[RCV_QUEUE_SIZE];
......@@ -507,6 +516,24 @@ void *send_thread(void *arg)
return NULL;
}
#ifdef BOARD_TELOSB
void *calib_thread(void *arg)
{
int *intPoint = (int*)arg;
printf("Got int: %d\n", *intPoint);
while(1)
{
xtimer_sleep(CALIBRATION_SLEEP_TIME);
msp430_init_dco();
/*calibrate xtimer and stdio again*/
xtimer_init();
stdio_init();
}
}
#endif
int main(void)
{
(void) puts("Welcome to RIOT!");
......@@ -515,8 +542,14 @@ int main(void)
//int res = i2c_init(I2C_DEV(0));
#if defined(BOARD_INGA_BLUE) || defined(BOARD_INGA_RED)
puts("This is an inga");
i2c_init(I2C_DEV(0));
#endif
#if defined (BOARD_TELOSB)
puts("This is a telosb");
int i = 5;
thread_create(calib_thread_stack, sizeof(calib_thread_stack), 1, THREAD_CREATE_STACKTEST, calib_thread, &i, "calib_thread");
#endif
//printf("i2c init: %s\n", res == 0 ? "OK\n" : "FAILED\n");
gnrc_netif_t *netif = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment