#include #include "cc110l.h" //#define BLINK1 0x40 //#define BLINK0 0x01 #define BLINK1 0x08 #define BLINK0 0x01 void delay_ms(uint16_t ms) { while (ms--) __delay_cycles(1000); } void blink(uint8_t val) { uint8_t bit = 7; while(1) { if (val & (1 << bit)) P1OUT |= BLINK1; else P1OUT |= BLINK0; delay_ms(200); P1OUT &= ~(BLINK0 | BLINK1); delay_ms(100); if (bit == 0) break; bit--; } } volatile int stop = 1; char data[] = "tutturu~"; int main() { // Disable watchdog WDTCTL = WDTPW | WDTHOLD; // 1MHz internal timer BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; // P2 (XOUT/XIN) as GPIO P2SEL = 0x00; // Radio MOSI, CLK, LEDs as output P1DIR = 0x20 | 0x80 | BLINK0 | BLINK1; // Radio CS as output P2DIR = 0x80; // Clear outputs P1OUT = 0x00; P2OUT = 0x00; delay_ms(200); radio_init(); uint8_t i; for (i = 0; i < 1000; i++) { P1OUT ^= BLINK0; radio_send((uint8_t *)data, sizeof(data)); delay_ms(10); } //delay_ms(200); // blink(0x81); P1OUT &= ~BLINK0; P1OUT |= BLINK1; return 0; }