X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=target%2Fradio%2Fradio.c;h=90bc47f31f649e7c4674bbe9586b9e2990e0137c;hp=ba693a775ab83f78622b244ec718871b63fbb062;hb=7b3fdf5b42c9be9bebc1ceb7a52ff0f5a2a28fcd;hpb=c41ceb9a488b2209d1d3c09967d1473ce608030f;ds=sidebyside diff --git a/target/radio/radio.c b/target/radio/radio.c index ba693a77..90bc47f3 100644 --- a/target/radio/radio.c +++ b/target/radio/radio.c @@ -46,6 +46,11 @@ sfr at 0xE1 RFST; sfr at 0x88 TCON; +sfr at 0xbe SLEEP; + +# define SLEEP_USB_EN (1 << 7) +# define SLEEP_XOSC_STB (1 << 6) + sbit at 0x89 RFTXRXIF; #define TCON_RFTXRXIF (1 << 1) @@ -428,7 +433,7 @@ low() { #define RF_POWER_7_DBM 0xc8 #define RF_POWER_10_DBM 0xc0 -#define RF_POWER RF_POWER_M30_DBM +#define RF_POWER RF_POWER_0_DBM static __code uint8_t radio_setup[] = { RF_PA_TABLE7_OFF, RF_POWER, @@ -518,6 +523,8 @@ radio_init() { main () { CLKCON = 0; + while (!(SLEEP & SLEEP_XOSC_STB)) + ; /* Set P2_0 to output */ radio_init (); delay(100);