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

@ -14,6 +14,11 @@
#include <stdint.h>
/* This port no longer implements the legacy clock_delay. Hack its usages
* outta the way till it gets phased out completely
* NB: This also overwrites the prototype so delay_usec() is declared twice */
#define clock_delay(t) clock_delay_usec(t)
/*
* lint - style defines to help syntax parsers with sdcc-specific 8051 code
* They don't interfere with actual compilation

View file

@ -126,7 +126,7 @@ cc2430_rf_command(uint8_t command)
case ISTXON:
fifo_count = RXFIFOCNT;
RFST = command;
clock_delay(2);
clock_delay_usec(2);
if(fifo_count != RXFIFOCNT) {
RFST = ISFLUSHRX;
RFST = ISFLUSHRX;
@ -430,7 +430,7 @@ transmit(unsigned short transmit_len)
cc2430_rf_command(ISTXON);
counter = 0;
while(!(RFSTATUS & TX_ACTIVE) && (counter++ < 3)) {
clock_delay(10);
clock_delay_usec(6);
}
if(!(RFSTATUS & TX_ACTIVE)) {

View file

@ -59,11 +59,11 @@ static volatile __data clock_time_t seconds = 0; /* Uptime in secs */
* Each iteration is ~1.0xy usec, so this function delays for roughly len usec
*/
void
clock_delay(unsigned int len)
clock_delay_usec(uint16_t len)
{
DISABLE_INTERRUPTS();
while(len--) {
ASM(nop); ASM(nop); ASM(nop);
ASM(nop); ASM(nop);
ASM(nop); ASM(nop);
}
ENABLE_INTERRUPTS();

View file

@ -19,6 +19,11 @@
#include "dev/watchdog.h"
#define watchdog_stop() watchdog_periodic()
/* This port no longer implements the legacy clock_delay. Hack its usages
* outta the way till it gets phased out completely
* NB: This also overwrites the prototype so delay_usec() is declared twice */
#define clock_delay(t) clock_delay_usec(t)
/*
* lint - style defines to help syntax parsers with sdcc-specific 8051 code
* They don't interfere with actual compilation

View file

@ -287,7 +287,7 @@ transmit(unsigned short transmit_len)
counter = 0;
while(!(FSMSTAT1 & FSMSTAT1_TX_ACTIVE) && (counter++ < 3)) {
clock_delay(10);
clock_delay_usec(6);
}
if(!(FSMSTAT1 & FSMSTAT1_TX_ACTIVE)) {

View file

@ -62,7 +62,7 @@ static volatile __data clock_time_t seconds = 0; /* Uptime in secs */
* Each iteration is ~1.0xy usec, so this function delays for roughly len usec
*/
void
clock_delay(unsigned int len)
clock_delay_usec(uint16_t len)
{
DISABLE_INTERRUPTS();
while(len--) {