Content originally posted in LPCWare by MikeSimmonds on Sun Feb 24 14:48:17 MST 2013
[FONT=Tahoma][SIZE=1]As promised, my number formatting code.
Typically, allocate a small buffer (e.g. 128 bytes -- you can use the stack) and call a series of
strtext, strhex, strdec etc. to build up yor report string.
[B]Don't forget[/B] to add a final null byte after the last format chunk.
The send this string to 'puts'
[B]NOTE[/B] in the puts source code, change the uart0 equate to match the register base address for the
uart you choose to use as set out in the user manual for the device (LPC part) you are using.
The full text is too long to post, get the code from the zip:(
[Edit]
[B]This is important too![/B]
I object very strongly to the way that ARM (the company) abribtrarily overturned 50+ (well at least 40) years of
tradition and changed the comment character from ';' to '@' (ugly in quantity). They then suggest the we use
the hijacked ';' as a statement seperator. Is this an attempt to make assember resemble "C" -- a forlorn attempt!
In any case, I am not prepared to put up with this, so I patch the 'arm-non-eabi-as.exe' (just have to swap two
bytes -- as long as they are the correct two) to get back the ';' as the comment character.
Before attempting to assemble my sources, do a global replace of ';' with '@'.
If the editor cannot do this in one operation, get a better editor!
Also change 'thumbFunc' (in amacs.inc) to 'thumb_func'. I have a serious down on underscores in names etc.
I should appologise for the inconvenience, but I place the original blame on ARM, so I don't.
[/Edit]
Cheers, Mike
[/SIZE][/FONT]