equal
deleted
inserted
replaced
107 int ecrt_slave_write_alias(ec_slave_t *slave, uint16_t alias); |
107 int ecrt_slave_write_alias(ec_slave_t *slave, uint16_t alias); |
108 |
108 |
109 /*****************************************************************************/ |
109 /*****************************************************************************/ |
110 // Bitwise read/write macros |
110 // Bitwise read/write macros |
111 |
111 |
112 #define EC_READ_BIT(PD, CH) (*((uint8_t *) (PD)) >> (CH)) & 0x01) |
112 #define EC_READ_BIT(PD, CH) ((*((uint8_t *) (PD)) >> (CH)) & 0x01) |
113 |
113 |
114 #define EC_WRITE_BIT(PD, CH, VAL) \ |
114 #define EC_WRITE_BIT(PD, CH, VAL) \ |
115 do { \ |
115 do { \ |
116 if (VAL) *((uint8_t *) (PD)) |= (1 << (CH)); \ |
116 if (VAL) *((uint8_t *) (PD)) |= (1 << (CH)); \ |
117 else *((uint8_t *) (PD)) &= ~(1 << (CH)); \ |
117 else *((uint8_t *) (PD)) &= ~(1 << (CH)); \ |