Using ST Visual Developer with Cosmic-C compiler.
Why do I keep getting "Invalid indirection operand" when creating a pointer?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-03-27 8:58 AM
I'm using ST Visual Developer with Cosmic-C compiler.
Writing code for STM8S903K3.
Making a pointer to get the value from a SPR register, ADC_DRH:
uint8_t *pv;
pv = *0x005404;
I keep getting the errors;
#error cpstm8 main.c:85(8+8) invalid indirection operand
#error cpstm8 main.c:86(1+7) misplaced local declaration
Don't know what I'm doing wrong.
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-03-27 5:53 PM
STVD hasn't provided the register definitions? Code'll never be pretty if you're poking memory like this. But if you insist...
volatile uint8_t *pv = (uint8_t *)0x005404;
*pv = <whatever you want to write>;
