函数返回值为enum的问题~ 为什么结果不对?
enum Endian_type { NO_ENDIAN=0, RESERVED, ENDIAN_SRC, ENDIAN_DST };
Endian_type get_Endian(UINT32 channel){ return Endian_type[(( gdma_ctrl_reg[channel] >> 21) & 0x03)]; } //可能有问题!
调用get_Endian(i)不是想要的值 肯定这样有问题
下面这个一样不行
Endian_type get_Endian(UINT32 channel){ return static_cast<Endian_type>(( gdma_ctrl_reg[channel] >> 21) & 0x03); } //可能有问题!