In the " CDD_Sbc_fs23.c" file ,API "Sbc_fs23_SetWakeupConfig" has two lines code,as follows:
/*--------------------------------------------------*/
u16TxData = (u16RxData & (~(SBC_FS23_M_WK1_WUEN_WAKEUP_MASK | SBC_FS23_M_WK2_WUEN_WAKEUP_MASK | SBC_FS23_M_HVIO1_WUEN_WAKEUP_MASK | SBC_FS23_M_HVIO2_WUEN_WAKEUP_MASK | SBC_FS23_M_LVIO3_WUEN_WAKEUP_MASK | SBC_FS23_M_LVIO4_WUEN_WAKEUP_MASK | SBC_FS23_M_LVI5_WUEN_WAKEUP_MASK))) | (*Sbc_fs23_pConfigPtr->Sbc_fs23_WuConfig)[WakeupSettingId].IoWuEnReg;
..................................
u16TxData = (u16RxData & (~(SBC_FS23_M_CAN_WUEN_WAKEUP_MASK | SBC_FS23_M_LIN_WUEN_WAKEUP_MASK | SBC_FS23_M_LDT_WUEN_WAKEUP_MASK))) | (*Sbc_fs23_pConfigPtr->Sbc_fs23_WuConfig)[WakeupSettingId].Wu1EnReg;
/*--------------------------------------------------*/
what means about “(u16RxData & (~............))| XxxxCfg.XxxxEnReg"? why not directly use“(u16RxData | XxxxCfg.XxxxEnReg"?
I don't understand the operation of "u16RxData & (~............)".
Solved! Go to Solution.
Hi,
By using & (~(………)) we make sure that those configurable wake-up and interrupt enable bits are first zeroed before writing a new value to them.
BR, Tomas
Hi,
By using & (~(………)) we make sure that those configurable wake-up and interrupt enable bits are first zeroed before writing a new value to them.
BR, Tomas