logs archiveBotHelp.net / Freenode / #43oh / 2015 / September / 1 / 7
Rickta59
typedef GPIO_PIN<BIT6,P2> P2_6;
then later i declare the function ...
template<>
ALWAYS_INLINE void P2_6::setmode_input(void)
Spirilis
man lol that is onerous
I just verbose'd the fu*k out of my .cpp and it's almost compiled...
Rickta59
so instead of type GPIO_PIN<BIT6,P2>::setmode_input(void) ...
i used the typedef
Spirilis
http://dpaste.com/1KCW6MW
hm I guess I need to qualify the parameters too
since the compiler must default the constants to int
Rickta59
sticky wicket that is
heh .. yeah the errors are less than obvious
simplest to get one thing working
then add the rest
it is coming back now ..
i think that is why i took a different approach with the lpc arm stuff
Spirilis
okay casting to uint8_t didn't work. hmm.
http://dpaste.com/224HGGG
should I just do *ucactl1?
and come to think of it, the params should be &UCA0CTL0 et al, not UCA0CTL0
Rickta59
are you using pointers or references?
if it is pointers then use *ucactl1
Spirilis
gotcha
yeah
Rickta59
i tended to use references
typedef volatile uint8_t & u8_SFR; /* 8 bit unsigned Special Function Register reference */
with a reference the compiler knows it is going to be constant
Spirilis
aaah
ok that's much better
Rickta59
volatile unsigned char * const u8 ...
that is probably what you want
http://cdecl.ridiculousfish.com/?q=volatile+unsigned+char+*+const+u8
Spirilis
nah using & instead of * worked great
almost compiling now
got a few SFR's wrong in their types
const vs non-const
Rickta59
i mean if you are trying to get const * to volatile data
Spirilis
k, is this the linker error: http://dpaste.com/2KS1X9A
undefined reference
Rickta59
possibly
use the msp430-elf-nm -CS foo.elf
to see what symbols are defined ...
actually on the .o ..
as you probably don't have a .elf
see if your names match up ..
or if they got truncated
Spirilis
yep
er
hm
names do show up
Rickta59
as text or undefined
'T' vs 'U' i think
Spirilis
http://dpaste.com/2KT1RJ6
ah k 'U'
UART_USCI.o has "no symbols"
Rickta59
i would skip the -ffunction- and -fdata for now
until you get it linking
Spirilis
well that got a little further-
/opt/local/msp430-elf-gcc/lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/bin/ld: region `ROM' overflowed by 30548 bytes
Rickta59
hmm .. fat man
Spirilis
let me doctor that up a bit :)
hmm no
fake linker script with 56K ROM still threw the undefined reference errors
alright this'll have to be a teaser for tomorrow
Rickta59
* goes to uninstall CCS msp430-elf-gcc and reload with what they ship
Spirilis
gotta get some real work done :)
Rickta59
* not sure what i have in there .. I hacked in a couple of changes and my own lib
Spirilis
humm
very basic 2-argument template still bombs
Rickta59
something else is afoot then
Spirilis
http://dpaste.com/1XEF2V5
3 files listed in there
let me try that volatile uint8_t * const idea
Rickta59
you might try const uint8_t pxbits
Spirilis
nah that bombs about wrong type
hmmm k
nah
/tmp/ccZh41pj.o: In function `main':
template_test.cpp:(.text.startup.main+0x4a): undefined reference to `FastIO<P1OUT, (unsigned char)1>::digitalWrite(int)'
template_test.cpp:(.text.startup.main+0x74): undefined reference to `FastIO<P1OUT, (unsigned char)1>::digitalWrite(int)'
collect2: error: ld returned 1 exit status
make: *** [template_test.elf] Error 1
humm
ok
roll it all up into the .h file and it works
guess that's giving me a hint ;)
and it works
yup
rolled it into UART_USCI.h
just compiled
ok, now I fully understand why your code is all a heaping pile of .h's :-)
still bizarre that having it in a .cpp *doesn't flat out work* but oh well
alas... I do feel this was worth going through, as it's a colossal sh*tton of a lot easier for building general purpose drivers
and it works
my test toggles P1OUT on when TXIE is enabled, off when TXIE is disabled, and I have a "uart.cpp" that just polls Serial.available() and writes back whatever it reads
sure enough, minicom sees an echo and the red LED faintly shows dim when I hold down a key on the keyboard for rapid fire
awesome
thanks again Rickta59 :)
now I shall go forth and write USCI drivers for everybody
« prev 1 2 3 4 5 6 7 8 next »