Code style fixes: sensinode examples

This commit is contained in:
George Oikonomou 2012-12-16 15:29:45 +00:00
parent 594ba9a0ed
commit 64a95dcb59
19 changed files with 205 additions and 251 deletions

View file

@ -48,7 +48,8 @@ AUTOSTART_PROCESSES(&clock_test_process);
/*---------------------------------------------------------------------------*/
#if TEST_RTIMER
void
rt_callback(struct rtimer *t, void *ptr) {
rt_callback(struct rtimer *t, void *ptr)
{
rt_now = RTIMER_NOW();
ct = clock_time();
printf("Task called at %u (clock = %u)\n", rt_now, ct);
@ -73,7 +74,7 @@ PROCESS_THREAD(clock_test_process, ev, data)
end_count = RTIMER_NOW();
diff = end_count - start_count;
printf("Requested: %u usec, Real: %u rtimer ticks = ~%u us\n",
10000 * i, diff, diff * 64);
10000 * i, diff, diff * 64);
i++;
}
#endif
@ -82,14 +83,14 @@ PROCESS_THREAD(clock_test_process, ev, data)
printf("Rtimer Test, 1 sec (%u rtimer ticks):\n", RTIMER_SECOND);
i = 0;
while(i < 5) {
etimer_set(&et, 2*CLOCK_SECOND);
etimer_set(&et, 2 * CLOCK_SECOND);
printf("=======================\n");
ct = clock_time();
rt_now = RTIMER_NOW();
rt_for = rt_now + RTIMER_SECOND;
printf("Now=%u (clock = %u) - For=%u\n", rt_now, ct, rt_for);
if (rtimer_set(&rt, rt_for, 1,
(void (*)(struct rtimer *, void *))rt_callback, NULL) != RTIMER_OK) {
if(rtimer_set(&rt, rt_for, 1, (rtimer_callback_t) rt_callback, NULL) !=
RTIMER_OK) {
printf("Error setting\n");
}
@ -99,7 +100,8 @@ PROCESS_THREAD(clock_test_process, ev, data)
#endif
#if TEST_ETIMER
printf("Clock tick and etimer test, 1 sec (%u clock ticks):\n", CLOCK_SECOND);
printf("Clock tick and etimer test, 1 sec (%u clock ticks):\n",
CLOCK_SECOND);
i = 0;
while(i < 10) {
etimer_set(&et, CLOCK_SECOND);