AnsweredAssumed Answered

Assign register value to variable

Question asked by volk.artem on Jun 6, 2011
Latest reply on Jun 7, 2011 by volk.artem
Good day!

I'm trying to assign register value to a variable in COSMIC C. I've tried the obvious way first, but it doesn't work:

uint8_t test = 0;
...
test = CLK->SWCR; // define from stm8s.h

and

uint8_t test = 0;
...
test = CLK_SWCR; // define from "C:\Program Files\COSMIC\CXSTM8_32K\Hstm8\iostm8s.h"

When I run my program in Debug mode and create a watch for 'test' variable it is always zero.

What can be wrong?

Thanks in advance! 

Outcomes