X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Flib%2Fmsp430x2618.c;h=947cf1430e29c9c9ec7c66c3a7d0c9c89e4e1936;hp=8b72683faeb8138235c26d92349467b61ec65f2e;hb=449640364dc1db2767ce30d3fb8b95bdaae119dd;hpb=757884d51cc6b119a3b1773873c446926b26011d diff --git a/firmware/lib/msp430x2618.c b/firmware/lib/msp430x2618.c index 8b72683..947cf14 100644 --- a/firmware/lib/msp430x2618.c +++ b/firmware/lib/msp430x2618.c @@ -11,7 +11,7 @@ #include //! Receive a byte. -unsigned char serial_rx(){ +unsigned char serial0_rx(){ char c; while(!(IFG2&UCA0RXIFG));//wait for a byte @@ -29,7 +29,7 @@ unsigned char serial1_rx(){ } //! Transmit a byte. -void serial_tx(unsigned char x){ +void serial0_tx(unsigned char x){ while ((IFG2 & UCA0TXIFG) == 0); //loop until buffer is free UCA0TXBUF = x; /* send the character */ while(!(IFG2 & UCA0TXIFG)); @@ -47,7 +47,7 @@ void serial1_tx(unsigned char x){ } //! Set the baud rate. -void setbaud(unsigned char rate){ +void setbaud0(unsigned char rate){ //Table 15-4, page 481 of 2xx Family Guide switch(rate){ @@ -131,6 +131,10 @@ void msp430_init_dco() { #endif + #ifdef STATICDCO + BCSCTL1 = (STATICDCO>>8); + DCOCTL = (STATICDCO&0xFF); + #else if(CALBC1_16MHZ!=0xFF){ //Info is intact, use it. BCSCTL1 = CALBC1_16MHZ; @@ -149,6 +153,7 @@ void msp430_init_dco() { choice[0]++; choice[0]%=dco_calibrations_count; } + #endif //Minor delay. while(i--);