fix reg operation missing

This commit is contained in:
Tian Hao 2017-07-07 19:10:02 +08:00 committed by Jiang Jiang Jian
parent 2e9db99921
commit 6bceb41bf7
3 changed files with 6 additions and 6 deletions

@ -1 +1 @@
Subproject commit 0f68ece75cd27b71def68b735e6a03db312a46c5
Subproject commit 30a3ab11c441630e3e76fbf30212e546db377e8e

View file

@ -30,7 +30,7 @@ extern "C" {
#define _DPORT_REG_WRITE(_r, _v) (*(volatile uint32_t *)(_r)) = (_v)
//write value to register
#define DPORT_REG_WRITE(_r, _v) _DPORT_REG_WRITE(_r, _v)
#define DPORT_REG_WRITE(_r, _v) _DPORT_REG_WRITE((_r), (_v))
//read value from register
static inline uint32_t IRAM_ATTR DPORT_REG_READ(uint32_t reg)
@ -97,7 +97,7 @@ static inline uint32_t IRAM_ATTR DPORT_READ_PERI_REG(uint32_t addr)
}
//write value to register
#define DPORT_WRITE_PERI_REG(addr, val) _DPORT_WRITE_PERI_REG(addr, val)
#define DPORT_WRITE_PERI_REG(addr, val) _DPORT_WRITE_PERI_REG((addr), (val))
//clear bits of register controlled by mask
#define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&(~(mask))))
@ -112,7 +112,7 @@ static inline uint32_t IRAM_ATTR DPORT_READ_PERI_REG(uint32_t addr)
#define DPORT_GET_PERI_REG_BITS(reg, hipos,lowpos) ((DPORT_READ_PERI_REG(reg)>>(lowpos))&((1<<((hipos)-(lowpos)+1))-1))
//set bits of register controlled by mask and shift
#define DPORT_SET_PERI_REG_BITS(reg,bit_map,value,shift) DPORT_WRITE_PERI_REG((reg),(DPORT_READ_PERI_REG(reg)&(~((bit_map)<<(shift))))|(((value) & bit_map)<<(shift)))
#define DPORT_SET_PERI_REG_BITS(reg,bit_map,value,shift) DPORT_WRITE_PERI_REG((reg), ((DPORT_READ_PERI_REG(reg)&(~((bit_map)<<(shift))))|(((value) & bit_map)<<(shift))))
//get field of register
#define DPORT_GET_PERI_REG_BITS2(reg, mask,shift) ((DPORT_READ_PERI_REG(reg)>>(shift))&(mask))

View file

@ -142,14 +142,14 @@
//write value to register
#define REG_WRITE(_r, _v) ({ \
ASSERT_IF_DPORT_REG(_r, REG_WRITE); \
ASSERT_IF_DPORT_REG((_r), REG_WRITE); \
(*(volatile uint32_t *)(_r)) = (_v); \
})
//read value from register
#define REG_READ(_r) ({ \
ASSERT_IF_DPORT_REG((_r), REG_READ); \
(*(volatile uint32_t *)_r); \
(*(volatile uint32_t *)(_r)); \
})
//get bit or get bits from register