]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
For tmicore platform, remove unused pin defs in hardware.h and add PxREN
authorsmckown <smckown@4bc1554a-c7f2-4f65-a403-e0be01f0239c>
Thu, 11 Sep 2008 22:40:16 +0000 (22:40 +0000)
committerR. Steve McKown <rsmckown@gmail.com>
Tue, 1 Dec 2009 03:00:56 +0000 (20:00 -0700)
initialization to MotePlatformC.  Set unused pins to be input with pull-up.
This should be far safer in terms of possible short events that setting
unused pins to outputs, since tmicore has an expansion header.

tos/platforms/tmicore/MotePlatformC.nc
tos/platforms/tmicore/hardware.h

index 7477a5627544a798152ae62c5af98ccdb0c1cb1d..bdf8d366e5297ec2e573fd3fec0d9377b30f7123 100644 (file)
@@ -47,32 +47,40 @@ implementation {
        /* Port 1: 7:BQSTAT2, 6:BQSTAT1, 5:-, 4:-, 3:CP_CTS, 2:CP_RTS, 1:BSL_TX, 0:- */
        P1SEL = 0;      /* 0 0 0 0 0 0 0 0 */
        P1OUT = 0x39;   /* 0 0 1 1 1 0 0 1 */
-       P1DIR = 0x39;   /* 0 0 1 1 1 0 0 1 */
+       P1DIR = 0x08;   /* 0 0 0 0 1 0 0 0 */
+       P1REN = 0x31;   /* 0 0 1 1 0 0 0 1 */
  
-       /* Port 2: 7:-, 6:-, 5:nBUTTON, 4:nUSB_SUSPEND, 3:-, 2:BSL_RX, 1:nUSBPG, 0:nSOLARPG */
+       /* Port 2:
+        * 7:-, 6:-, 5:BUTTONn, 4:USB_SUSPENDn, 3:-, 2:BSL_RX, 1:USBPGn, 0:SOLARPGn
+        */
        P2SEL = 0;      /* 0 0 0 0 0 0 0 0 */
        P2OUT = 0xc8;   /* 1 1 0 0 1 0 0 0 */
-       P2DIR = 0xc8;   /* 1 1 0 0 1 0 0 0 */
+       P2DIR = 0x00;   /* 0 0 0 0 0 0 0 0 */
+       P2REN = 0xc8;   /* 1 1 0 0 1 0 0 0 */
 
        /* Port 3: 7:UC_RX, 6:UC_TX, 5:-, 4:-, 3:UC_SCK, 2:UC_SOMI, 1:UC_SIMO, 0:- */
-       P3SEL = 0xc7;   /* 1 1 0 0 1 1 1 0 */
+       P3SEL = 0xce;   /* 1 1 0 0 1 1 1 0 */
        P3OUT = 0x7b;   /* 0 1 1 1 1 0 1 1 */
-       P3DIR = 0x7b;   /* 0 1 1 1 1 0 1 1 */
+       P3DIR = 0x4a;   /* 0 1 0 0 1 0 1 0 */
+       P3REN = 0x31;   /* 0 0 1 1 0 0 0 1 */
 
-       /* Port 4: 7:-, 6:nLED2, 5:nLED1, 4:nFLH_CS, 3:-, 2:-, 1:-, 0:- */
+       /* Port 4: 7:-, 6:LED2n, 5:LED1n, 4:-, 3:-, 2:-, 1:-, 0:- */
        P4SEL = 0;      /* 0 0 0 0 0 0 0 0 */
        P4OUT = 0xff;   /* 1 1 1 1 1 1 1 1 */
-       P4DIR = 0xff;   /* 1 1 1 1 1 1 1 1 */
+       P4DIR = 0x60;   /* 0 1 1 0 0 0 0 0 */
+       P4REN = 0x9f;   /* 1 0 0 1 1 1 1 1 */
 
        /* Port 5: 7:-, 6:-, 5:-, 4:-, 3:-, 2:-, 1:-, 0:- */
        P5SEL = 0;      /* 0 0 0 0 0 0 0 0 */
        P5OUT = 0xff;   /* 1 1 1 1 1 1 1 1 */
-       P5DIR = 0xff;   /* 1 1 1 1 1 1 1 1 */
+       P5DIR = 0;      /* 0 0 0 0 0 0 0 0 */
+       P5REN = 0xff;   /* 1 1 1 1 1 1 1 1 */
 
        /* Port 6: 7:-, 6:-, 5:-, 4:-, 3:-, 2:-, 1:-, 0:ADC_VBATT */
        P6SEL = 0x01;   /* 0 0 0 0 0 0 0 1 */
        P6OUT = 0;      /* 0 0 0 0 0 0 0 0 */
        P6DIR = 0;      /* 0 0 0 0 0 0 0 0 */
+       P6REN = 0xff;   /* 1 1 1 1 1 1 1 1 */
 
        P1IE = 0;
        P2IE = 0;
index 54f87e170ddf10e5be2ecc13779397f12123c1b3..c556ef08ee33562470a11cab84b87e7b91becd99 100755 (executable)
@@ -6,28 +6,6 @@
 //#include "CC2420Const.h"
 //#include "AM.h"
 
-// LEDs
-TOSH_ASSIGN_PIN(nLED1, 4, 5);
-TOSH_ASSIGN_PIN(nLED2, 4, 6);
-
-// UART pins
-TOSH_ASSIGN_PIN(UC_SOMI, 3, 2);
-TOSH_ASSIGN_PIN(UC_SIMO, 3, 1);
-TOSH_ASSIGN_PIN(UC_SCK, 3, 3);
-TOSH_ASSIGN_PIN(UC_TX, 3, 6);
-TOSH_ASSIGN_PIN(UC_RX, 3, 7);
-
-// ADC
-TOSH_ASSIGN_PIN(ADC_VBATT, 6, 0);
-
-// FLASH
-TOSH_ASSIGN_PIN(nFLH_CS, 4, 4);
-
-// PROGRAMMING PINS (tri-state)
-//TOSH_ASSIGN_PIN(TCK, );
-TOSH_ASSIGN_PIN(PROG_RX, 1, 1);
-TOSH_ASSIGN_PIN(PROG_TX, 2, 2);
-
 // need to undef atomic inside header files or nesC ignores the directive
 #undef atomic