]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Mintor tweaks to usci
authorsmckown <smckown@4bc1554a-c7f2-4f65-a403-e0be01f0239c>
Mon, 8 Sep 2008 23:11:16 +0000 (23:11 +0000)
committerR. Steve McKown <rsmckown@gmail.com>
Tue, 1 Dec 2009 03:00:50 +0000 (20:00 -0700)
tos/chips/msp430/usci/Msp430UartP.nc
tos/chips/msp430/usci/Msp430Usci.h
tos/chips/msp430/usci/Msp430UsciConfigure.nc

index ad919b82249137f6cc158bc84a8c63cb61c94f7d..2ef1736f95954679858031bdd39bf01b8c8ef862 100644 (file)
@@ -90,7 +90,7 @@ implementation {
   async command void ResourceConfigure.configure()
   {
     atomic {
-      msp430_usci_config_t* config = call Msp430UsciConfigure.get();
+      const msp430_usci_config_t* config = call Msp430UsciConfigure.get();
 
       call Registers.setCtl1(UCSWRST);
 
@@ -280,9 +280,9 @@ implementation {
       signal UartStream.receivedByte(byte);
   }
 
-  default async command msp430_usci_config_t* Msp430UsciConfigure.get()
+  default async command const msp430_usci_config_t* Msp430UsciConfigure.get()
   {
-    static msp430_usci_config_t def = { 
+    const static msp430_usci_config_t def = { 
       uart: {
        ctl0: UCMODE_0,         /* async, lsb first, 8N1 */
        ctl1: UCSWRST|UCSSEL_1, /* clock uart from SMCLK */
index 880a92da8a56bbfc27d5431dffc7dc80ba2a5a37..482998225e41bd04aa05050bae544ddc69f00165 100644 (file)
@@ -82,10 +82,14 @@ typedef struct {
 
 /* Baud rates for UART mode.  Only 32KHz modes work right now. */
 typedef enum {
-  /* UCOS16=0.  UMCTL = UCBRFx << 4 + UCBRSx << 1 + UCOS16. */
+  /* UCOS16=0.  UMCTL = UCBRFx << 4 + UCBRSx << 1 + UCOS16.
+   * 1MHZ = 1,048576HZ, 1E6MHZ = 1,000,000HZ.
+   */
   UBRX_32768HZ_9600=3, UMCTL_32768HZ_9600=(0 << 4) + (3 << 1) + 0,
   UBRX_1MHZ_9600=109, UMCTL_1MHZ_9600=(0 << 4) + (2 << 1) + 0,
   UBRX_1MHZ_115200=9, UMCTL_1MHZ_115200=(0 << 4) + (1 << 1) + 0,
+  UBRX_1E6MHZ_9600=104, UMCTL_1E6MHZ_9600=(0 << 4) + (1 << 1) + 0,
+  UBRX_1E6MHZ_115200=8, UMCTL_1E6MHZ_115200=(0 << 4) + (6 << 1) + 0,
 } msp430_usci_uart_rate_t;
 
 typedef union {
index d7bab281a3260790870afd36cbf3816e2040e3ce..77cb87d25ab455f502fd797099228fc28807b8af 100644 (file)
@@ -36,5 +36,5 @@
 #include "Msp430Usci.h"
  
 interface Msp430UsciConfigure {
-  async command msp430_usci_config_t* get();
+  async command const msp430_usci_config_t* get();
 }