void TwitterSerialBegin() { TwitterSerialEnabled = 1; SerialBegin(); OnSerial(TwitterOnReceiveFromSerial); }
void main() { WDTCTL = WDTPW + WDTHOLD; // Disable Watchdog timer. TODO: remove this once full library implemented and INIT() called. DCOCTL = 0x00; // Set DCOCLK to 1MHz BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; SerialBegin(9600); // Todo: Add support for more baud rates and oscillations while(1) { println("Hello\r\n"); } }
int main(void) { // Stop whatchdog WDTCTL = WDTPW + WDTHOLD; // Set clock to 1 MHz BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; if (DEBUG) SerialBegin(SERIALSPEED, CLK_SPEED); // Init the Ports and the timers initPorts(); if (DEBUG) { serialPrintln("Init Done!"); serialPrint("CLK at: "); serialPrintInt(CLK_SPEED); serialPrintln(" MHz"); serialPrint("PWM at: "); serialPrintInt(PWM_FREQUZENCY); serialPrintln(" kHz"); serialPrint("Periode: "); serialPrintInt(PWM_PERIODE); serialPrintln(" clkCycles"); } // Do forever and for always while(1) { // If Push Button pressed if (!(P1IN & BIT3)) { // Send specifid Code sendCode(CODE); // Display sending with LED on P1OUT |= BIT0; // Wait so that no Burst can be sended _delay_cycles(DELAY_BETWEEN_TWO_SENDS); } else { // Turn LED off P1OUT &= ~BIT0; } } }