|
Forum Index : Microcontroller and PC projects : CSUBs in 5.06
| Author | Message | ||||
| jirsoft Guru Joined: 18/09/2020 Location: Czech RepublicPosts: 533 |
Hi Peter, when I'm trying to get CSUBs working in 5.06 FW, I'm crashing the CMM2 all the time. Do I need to change somehow the compilation of the CSUB? I'm not using ARMCFunctions.h and I have still arm-gcc-link.ld the same version (2826 byte long). From this simple code (tried to fix ScrollingText demo): void FixBytes(long long *scr, long long int *x, long long int *y, long long int *w, long long int *h, long long int *nc) //'FixBytes screenAdr, X, Y, W, H, newColor { char *adr; adr = (char *)scr; for (int i = 0; i < 80000; i++) *adr++ = i & 0xFF; } Called from MMBasic with first parameter: dim integer page1Adr = MM.INFO(PAGE ADDRESS 1) It crashes the CMM2. The CSUB is : CSUB FixBytes 'FixBytes screenAdr, X, Y, W, H, newColor 00000000 'FixBytes 4A042300 F8003801 33013F01 D1FA4293 BF004770 00013880 END CSUB Jiri Napoleon Commander and SimplEd for CMM2 (GitHub), CMM2.fun |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10590 |
The issue is the way you are passing scr Try void FixBytes(unsigned int *scr) //'FixBytes screenAdr, X, Y, W, H, newColor { char *adr; adr = (char *)scr[0]; for (int i = 0; i < 80000; i++) *adr++ = i & 0xFF; } Also start CSUB development with optimisation off and only increase it when everything is working. Then you can see if it breaks anything Edited 2020-12-10 05:58 by matherp |
||||
| RCMAN Newbie Joined: 31/10/2020 Location: CanadaPosts: 29 |
Where can I read about using Csub in my code? And is this documentation current? Thanks RC |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10590 |
Where can I read about using Csub in my code? And is this documentation current? https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=12289 Is as good as you are going to get |
||||
| RCMAN Newbie Joined: 31/10/2020 Location: CanadaPosts: 29 |
Thanks |
||||
| jirsoft Guru Joined: 18/09/2020 Location: Czech RepublicPosts: 533 |
Thanks, I will try it. Jiri Napoleon Commander and SimplEd for CMM2 (GitHub), CMM2.fun |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |