ReinerS Posted February 21, 2007 Report Share Posted February 21, 2007 Hello all,I am just looking at the c-code for the ain64-din128-dout128 example to work out how the MIOS_MPROC_EVENT_TABLE works. I am stumbling across the following:In mios.tables.inc MIOS_MPROC_EVENT_TABLE is defined to be 256 entries of size 2Bytes (dw), so it is 512 Bytes. (Makes sense to me, for 128 buttons I need to store 2 messages per button (on and off), and I need two bytes to define each).In cmios.h, however, MIOS_MPROC_EVENT_TABLE is declared as unsigned char [2*128], so it is only 256 Bytes long, only half the size!Do I only have access to half of the table in C-programs? ??? ???many thanksReiner Quote Link to comment Share on other sites More sharing options...
ReinerS Posted February 21, 2007 Author Report Share Posted February 21, 2007 SOLVED, sorry!I had called MIOS_LCD_PrintCString with a simple char as argument.Weird error message anyway.So just disregard my question!Reiner Quote Link to comment Share on other sites More sharing options...
audiocommander Posted February 21, 2007 Report Share Posted February 21, 2007 Is this "SOLVED" related to this topic or to the SDCC crash? Quote Link to comment Share on other sites More sharing options...
ReinerS Posted February 21, 2007 Author Report Share Posted February 21, 2007 Is this "SOLVED" related to this topic or to the SDCC crash?oops, sorry, goofed this up. It's for the SDCC crash! Quote Link to comment Share on other sites More sharing options...
ReinerS Posted February 22, 2007 Author Report Share Posted February 22, 2007 Hello,I would like to come back to my original question of this thread:The table MIOS_MPROC_EVENT_TABLE has 512 bytes (256 dw entries) on the assembler side, defined in mios_tables.inc. On the C-cide it is defined as an extern const unsigned char [2*128], so 256 bytes. Does this mean that I can only acces the first 128 entries of the table? Or can I safely ignore the size of the array in the cmios.h file and access the data beyond the first 128 entries? (I assume the latter, I would actually be surprised if the SDCC supports runtime array bounds checking).Does anybody know the answer?ThanksReiner Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.