Adjust cc2x3x ports to the new clock API

This commit is contained in:
George Oikonomou 2012-04-30 13:30:34 +01:00
parent efd6d12831
commit 1f7171f943
11 changed files with 39 additions and 29 deletions

View file

@ -76,7 +76,7 @@ PROCESS_THREAD(energy_scan, ev, data)
while(1) {
cmax = RSSI_BASE;
cc2430_rf_channel_set(channel);
clock_delay(200);
clock_delay_usec(200);
for(j = 0; j < RSSI_SAMPLES; j++) {
t0 = RTIMER_NOW();

View file

@ -16,14 +16,14 @@
#include <stdio.h>
/*---------------------------------------------------------------------------*/
#define TEST_CLOCK_DELAY 1
#define TEST_RTIMER 1
#define TEST_ETIMER 1
#define TEST_CLOCK_SECONDS 1
#define TEST_CLOCK_DELAY_USEC 1
#define TEST_RTIMER 1
#define TEST_ETIMER 1
#define TEST_CLOCK_SECONDS 1
/*---------------------------------------------------------------------------*/
static struct etimer et;
#if TEST_CLOCK_DELAY
#if TEST_CLOCK_DELAY_USEC
static rtimer_clock_t start_count, end_count, diff;
#endif
@ -64,16 +64,16 @@ PROCESS_THREAD(clock_test_process, ev, data)
PROCESS_YIELD();
#if TEST_CLOCK_DELAY
printf("Clock delay test, (10,000 x i) cycles:\n");
#if TEST_CLOCK_DELAY_USEC
printf("clock_delay_usec test, (10,000 x i) usec:\n");
i = 1;
while(i < 7) {
start_count = RTIMER_NOW();
clock_delay(10000 * i);
clock_delay_usec(10000 * i);
end_count = RTIMER_NOW();
diff = end_count - start_count;
printf("Delayed %u = %u rtimer ticks = ~%u us\n", 10000 * i, diff,
diff * 64);
printf("Requested: %u usec, Real: %u rtimer ticks = ~%u us\n",
10000 * i, diff, diff * 64);
i++;
}
#endif