Closed rei-vilo closed 12 years ago
This could be solved by:
#ifdef __cplusplus
#include "WCharacter.h"
#include "WString.h"
+#if defined( __MSP430_HAS_USCI__ )
#include "HardwareSerial.h"
+#else
+#include <TimerSerial.h>
+TimerSerial Serial;
+#endif
uint16_t makeWord(uint16_t w);
uint16_t makeWord(byte h, byte l);
But won't work since Energia.h
is not going through the pre-processor like the Sketch is and the compiler will complain about not being able to find TimerSerial.h
. The preprocessor basically looks at all the include files and will copy the lib that goes with it to the tmp directory for compilation.
Alternatively we could just move TimerSerial into the core and be done with it.
I will have a look at if there is a clean way to address this in the preprocessor build into the IDE.
I like the idea of just moving TimerSerial.h to the core and turning it on by default for non USCI chips.
I grabbed this and will start working on it.
Good idea!
So I have something working. I haven't checked it in yet. Part of the solution for making it work well with the lower end chips is changing the UART speed to 4800. This makes the communication more reliable when running @ 1MHz. I'm leaning towards just changing the baud rate anyplace in the Examples where Serial.begin() is called to Serial.begin(4800). What are peoples thoughts about this.
This will make it so much easier for everybody so go for it. I rather have a slower port than all the questions about not working Serial. Can you put a comment that devices running at 16MHz can run serial at up to 9600?
there are 48 instances of begin(9600) hmm ...
You can a look at the issue_60 branch and try out what I have so far.
Very nice and so much better. Pulled it into master..
As suggested by RickKimball on #58
The code raises the following error messages:
Moreover,
#if defined...
is bugged on Arduino IDE and reported under Issue 906: #ifdef's and /* */ comments don't keep libraries from being loadedvoid begin(void);
for TimerSerialvoid begin(unsigned long);
for HardwareSerial