- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there anyway to define a variable of arbitrary size in Nios Software? for example a 16 bit variable. I know we can use some known types in C like int,... but the size of these variables vary with the compiler. Is there a class defined to use in such cases?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
THere's multiple solutions to that:
a) define your own variable declarations, and use them in your code......could be a problem if you need to re-use existing code, but you can easily redefine it when you move your code to a different target. b) some projects/Compilers/tools already bring predefined types like BYTE, WORD, DWORD...... this might or might not work when using your code to other tools/targets, but you be optimistic to have these types on a new target (if not, you can define them to your needs). c) use alt_types.h, which defines alt_u8, alt_u16, alt_u32, alt_s8, alt_s16, alt_s32 and so on.....accounts for altera tools only, apart from that same as (b).- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tnx, so much. I have another question.What is a context argument? Im trying to write ISRs. I've noticed that one of the parameters that alt_irq_register() takes, is context argument.
tnx in advance.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page