Exemplo n.º 1
0
void tosthread_main(void* arg) {
  amRadioStart();

  tosthread_create(&bounceThread0, bounceThread0_start, NULL, 300);
  tosthread_create(&bounceThread1, bounceThread1_start, NULL, 300);
  tosthread_create(&bounceThread2, bounceThread2_start, NULL, 300);
}
Exemplo n.º 2
0
void blink2_thread(void* arg) {
  if(blink2_count++ == 170)
    led2Toggle();
  tosthread_create(&thread_handler, blink0_thread, NULL, 100);
  tosthread_create(&thread_handler, blink1_thread, NULL, 100);
  tosthread_create(&thread_handler, blink2_thread, NULL, 100);
}
Exemplo n.º 3
0
void tosthread_main(void* arg) {
  while(1) {
    tosthread_create(&thread_handler, blink0_thread, NULL, 100);
    tosthread_create(&thread_handler, blink1_thread, NULL, 100);
    tosthread_create(&thread_handler, blink2_thread, NULL, 100);
  }
}
/*
 * Main method
 */
void tosthread_main(void* arg) {
	bs_params_init( &radioRx_params );

	amRadioStart();
	amSerialStart();
	//initiate threads
	tosthread_create(&(radioRx_params.receive_handle), radioReceive_thread, NULL, 200);
	tosthread_create(&(radioRx_params.send_handle), radioSend_thread, NULL, 200);
	tosthread_create(&(radioRx_params.receive_handle), serialReceive_thread, NULL, 200);
}
Exemplo n.º 5
0
void tosthread_main(void* arg) {
  mutex_init(&data_mutex);
  barrier_reset(&send_barrier, NUM_SENSORS+1);
  barrier_reset(&sense_barrier, NUM_SENSORS+1);
  sensor_data = radioGetPayload(&send_msg, sizeof(sensor_data_t));
  sensor_data->seq_no = 0;

  amRadioStart();
  tosthread_create(&humidity, humidity_thread, NULL, 200);
  tosthread_create(&temperature, temperature_thread, NULL, 200);
  tosthread_create(&total_solar, total_solar_thread, NULL, 200);
  tosthread_create(&photo_active, photo_active_thread, NULL, 200);
  tosthread_create(&send_handler, send_thread, NULL, 200);
}
Exemplo n.º 6
0
void tosthread_main(void* arg) {
  tosthread_create(&printf_thread, thread_run, NULL, 200);
}
Exemplo n.º 7
0
void tosthread_main(void* arg) {
  while( amRadioStart() != SUCCESS );
  tosthread_create(&radioStress0, radioStress0_thread, &msg0, 200);
  tosthread_create(&radioStress1, radioStress1_thread, &msg1, 200);
  tosthread_create(&radioStress2, radioStress2_thread, &msg2, 200);
}