Jump to content

Recommended Posts

Posted

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 thanks

Reiner

Posted

SOLVED, sorry!

I had called MIOS_LCD_PrintCString with a simple char as argument.

Weird error message anyway.

So just disregard my question!

Reiner

Posted

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?

Thanks

Reiner

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...