diff options
author | Guillaume Knispel <gknispel@avencall.com> | 2012-08-24 20:05:18 +0200 |
---|---|---|
committer | Guillaume Knispel <gknispel@avencall.com> | 2012-08-24 20:05:18 +0200 |
commit | 038315436032e25c06110c3473c83d7fdffb3e9f (patch) | |
tree | e4058544e6e77731620d98c46463c29c582564c3 | |
parent | 3c5f451ceee218576ea988617a22a74a48cfce57 (diff) |
allow build of the release version + add serial tx functions
-rw-r--r-- | PwrSeq.ewp | 12 | ||||
-rwxr-xr-x[-rw-r--r--] | hardware.h | 2 | ||||
-rwxr-xr-x | main.c | 28 |
3 files changed, 34 insertions, 8 deletions
@@ -955,7 +955,7 @@ <option>
<name>ULPRules</name>
<version>0</version>
- <state>0111111111111111111</state>
+ <state>0011000111111111111</state>
</option>
<option>
<name>ULPEnable</name>
@@ -1623,7 +1623,7 @@ </option>
<option>
<name>OutputFile</name>
- <state>PwrSeq.txt</state>
+ <state>PwrSeq.d43</state>
</option>
<option>
<name>OutputFormat</name>
@@ -1748,7 +1748,7 @@ <option>
<name>ModuleLocalSym</name>
<version>0</version>
- <state>0</state>
+ <state>2</state>
</option>
<option>
<name>CrcBitOrder</name>
@@ -1781,11 +1781,11 @@ </option>
<option>
<name>DebugInformation</name>
- <state>1</state>
+ <state>0</state>
</option>
<option>
<name>RuntimeControl</name>
- <state>1</state>
+ <state>0</state>
</option>
<option>
<name>IoEmulation</name>
@@ -1930,7 +1930,7 @@ <option>
<name>ULPRules</name>
<version>0</version>
- <state>0111111111111111111</state>
+ <state>0011000111111111111</state>
</option>
<option>
<name>ULPEnable</name>
diff --git a/hardware.h b/hardware.h index 7c017f2..146bffa 100644..100755 --- a/hardware.h +++ b/hardware.h @@ -108,7 +108,7 @@ PxIES_INIT //Interrupt Edge Select (0=pos 1=neg) // PORT3 #define P3OUT_INIT 0 #define P3DIR_INIT (SYS_PWR_OK | VRMPWRGD) -#define P3SEL_INIT 0 +#define P3SEL_INIT (MSP_BSL_TXD | MSP_BSL_RXD) // PORT4 #define P4OUT_INIT (SLP_S3_N) @@ -25,6 +25,8 @@ #include <io430.h> #include <intrinsics.h> +#include <stdio.h> + #include "def.h" #include "hardware.h" @@ -90,12 +92,35 @@ static void SerialInit(void) // Configure port for UART access // Pin 25 as UCA0TXD // Pin 26 as UCA0RXD - P3SEL |= 0x60; + P3SEL |= 0x30; UCA0CTL1_bit.UCSWRST = 0; } +static void ll_putchar(unsigned char c) +{ + while (!IFG2_bit.UCA0TXIFG); + UCA0TXBUF = c; +} + + +size_t __write(int handle, const unsigned char * buffer, size_t size) +{ + size_t nChars = 0; + + if (buffer == 0) + return 0; + + for (; size != 0; --size) { + ll_putchar(*buffer++); + ++nChars; + } + + return nChars; +} + + int main(void) { u16 state, resetState; @@ -106,6 +131,7 @@ int main(void) InitPorts(); GlobalInit(); + SerialInit(); __enable_interrupt(); |