Shop OBEX P1 Docs P2 Docs Learn Events
C4SX: A workaround and two fixes on the way! — Parallax Forums

C4SX: A workaround and two fixes on the way!

RW SenserRW Senser Posts: 61
edited 2007-08-23 05:57 in General Discussion
Greetings!· If you are interested in the C4SX C enviroment for the SX, you'll likely be interested in this posting:

Fixed CC1B Bugs - these bugs are noted in the C4SX 0.2 documentation.
·
Thanks to efforts of the CC1B author, the following two problems/bugs have been fixed and the fixes will be in the next CC1B release.· I do not yet have a release date for the next CC1B.· The second problem has a tested workaround, and it is noted below.
·
*** FIXED in next release ***
1)· Issue with 'const char * pointers'.· C example: int puts(const char *in_str)
The root issue is with the pointers that access the const char data.· Simple solution is not to use 'const char' coding techniques.· If you must use them then be sure the pointer to the const char data is in the lower 4 pages of RAM.· This approach allows the sertstc.c and sxstring.c sample programs to work.· This bug appears on the SX28 and is likely also on the SX48.
·
*** FIXED in next release ***
2)· Issue with setting TRIS<x>, PLP_<x> and LVL_<x> mode values for I/O on the SX48.· The first of these registers gets set in a C code sequence, sometimes the others do not.· The SX48 sxstring48.c program works around this by only setting TRISA and not setting the other two mode values as they are not really needed.
·
Workaround:· (Note this problem only happens on the SX48, not an issue for the SX28)· Add the follow pragma statements around the C code setting the mode values:
·
#pragma optimize 8:0·· // turn off type 8 optimization
·
#pragma optimize 8:1·· // turn on type 8 optimization
·
For example:
·
··············· // fix
··············· #pragma optimize 8:0·· // turn off type 8 optimization
··············· LVL_A = 0x00;·· // all CMOS voltages
··············· PLP_A = 0xff;·· // pull-ups off
·· ············TRISA = 0x07;·· // %00000111 -- pin 3 output, others input
··············· // fix
··············· #pragma optimize 8:1·· // turn on type 8 optimization

If anyone has questions, please let me know!

Thanks,
RW Senser

Comments

  • James NewtonJames Newton Posts: 329
    edited 2007-08-23 05:57
    RWSensor said...
    ...the following two problems/bugs have been fixed and the fixes will be in the next CC1B release...
    And THAT, my friends, is how a REAL compiler vendor responds.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



Sign In or Register to comment.