* if it's an IO register (> 31) also (try to) call any callback that was
* registered to track changes to that register.
*/
-static inline void _avr_set_r(avr_t * avr, uint8_t r, uint8_t v)
+static inline void _avr_set_r(avr_t * avr, uint16_t r, uint8_t v)
{
REG_TOUCH(avr, r);
SREG();
}
if (r > 31) {
- uint8_t io = AVR_DATA_TO_IO(r);
+ avr_io_addr_t io = AVR_DATA_TO_IO(r);
if (avr->io[io].w.c)
avr->io[io].w.c(avr, r, v, avr->io[io].w.param);
else
READ_SREG_INTO(avr, avr->data[R_SREG]);
} else if (addr > 31 && addr < 31 + MAX_IOs) {
- uint8_t io = AVR_DATA_TO_IO(addr);
+ avr_io_addr_t io = AVR_DATA_TO_IO(addr);
if (avr->io[io].r.c)
avr->data[addr] = avr->io[io].r.c(avr, addr, avr->io[io].r.param);
*/
static inline uint8_t avr_regbit_set(avr_t * avr, avr_regbit_t rb)
{
- uint8_t a = rb.reg;
+ uint16_t a = rb.reg;
uint8_t m;
if (!a)
static inline uint8_t avr_regbit_setto(avr_t * avr, avr_regbit_t rb, uint8_t v)
{
- uint8_t a = rb.reg;
+ uint16_t a = rb.reg;
uint8_t m;
if (!a)
*/
static inline uint8_t avr_regbit_setto_raw(avr_t * avr, avr_regbit_t rb, uint8_t v)
{
- uint8_t a = rb.reg;
+ uint16_t a = rb.reg;
uint8_t m;
if (!a)
static inline uint8_t avr_regbit_get(avr_t * avr, avr_regbit_t rb)
{
- uint8_t a = rb.reg;
+ uint16_t a = rb.reg;
if (!a)
return 0;
//uint8_t m = rb.mask << rb.bit;
*/
static inline uint8_t avr_regbit_from_value(avr_t * avr, avr_regbit_t rb, uint8_t value)
{
- uint8_t a = rb.reg;
+ uint16_t a = rb.reg;
if (!a)
return 0;
return (value >> rb.bit) & rb.mask;
*/
static inline uint8_t avr_regbit_get_raw(avr_t * avr, avr_regbit_t rb)
{
- uint8_t a = rb.reg;
+ uint16_t a = rb.reg;
if (!a)
return 0;
//uint8_t m = rb.mask << rb.bit;
static inline uint8_t avr_regbit_clear(avr_t * avr, avr_regbit_t rb)
{
- uint8_t a = (rb.reg);
+ uint16_t a = rb.reg;
uint8_t m = rb.mask << rb.bit;
avr_core_watch_write(avr, a, avr->data[a] & ~m);
return avr->data[a];
int i;
for (i = 0; i < count; i++, rb++) if (rb->reg) {
- uint8_t a = (rb->reg);
+ uint16_t a = rb->reg;
res |= ((avr->data[a] >> rb->bit) & rb->mask) << i;
}
return res;