CXSTM8 bug when writing to bit structure
To optimize the code I put nearly all the flags to bit structures. Now I came across a bug in the CXSTM8 when writing to bits. Reading bits doesn't bring any problem.
The good news for me is that I found a workaround. Here is the example:/*----------------------------------------------------*/
typedef struct
{int
sem_on :1;/* bit */
int
sem_off :1;/* bit */
int
sem_tog :1;/* bit */
} key_;/*struct*/
key_ key_x;/*struct*/
key_* key_down = &key_x;&sharppragma
sectionconst
{}/*struct*/
key_*const
key_up = &key_x;void clear_key_updown(
void
) {/*struct*/
key_* p_key;key_down->sem_on = 0;
/* variable pointer ..
- ******** ERROR: bad addressing mode *********/ (*key_down).sem_on = 0;/* alternate expression ..
- ******** ERROR: bad addressing mode *********/p_key = key_down;
/* pointer substitution - o.k. */
p_key->sem_on = 0; key_up->sem_on = 0;/* const pointer - o.k. */
(*key_up).sem_on = 0;/* alternate expression - o.k. */
}/*---------end of file------------------------------*/
The workaround you can see is to substitute the specific pointers. WoRo #cxstm8 #cxstm8