mirror of https://github.com/ARMmbed/mbed-os.git
fix 'enumerated type mixed with another type' IAR warnings
parent
7817a228e9
commit
6f3852dd59
|
@ -41,7 +41,7 @@ void port_init(port_t *obj, PortName port, int mask, PinDirection dir)
|
|||
|
||||
void port_mode(port_t *obj, PinMode mode)
|
||||
{
|
||||
gpio_t gpio = {.pin = 0, .direction = obj->direction, .drive_mode = obj->drive_mode};
|
||||
gpio_t gpio = {.direction = obj->direction, .drive_mode = obj->drive_mode};
|
||||
for (uint8_t pin = 0; pin < 8; pin++) {
|
||||
if ((1 << pin) & obj->mask) {
|
||||
gpio.pin = port_pin(obj->port, pin);
|
||||
|
@ -52,7 +52,7 @@ void port_mode(port_t *obj, PinMode mode)
|
|||
|
||||
void port_dir(port_t *obj, PinDirection dir)
|
||||
{
|
||||
gpio_t gpio = {.pin = 0, .direction = obj->direction, .drive_mode = obj->drive_mode};
|
||||
gpio_t gpio = {.direction = obj->direction, .drive_mode = obj->drive_mode};
|
||||
for (uint8_t pin = 0; pin < 8; pin++) {
|
||||
if ((1 << pin) & obj->mask) {
|
||||
gpio.pin = port_pin(obj->port, pin);
|
||||
|
|
|
@ -151,11 +151,11 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
|
|||
static const cyhal_uart_event_t interrupt_mask = (cyhal_uart_event_t)
|
||||
(CYHAL_UART_IRQ_RX_DONE | CYHAL_UART_IRQ_RX_ERROR | CYHAL_UART_IRQ_RX_NOT_EMPTY);
|
||||
ser->rx_event_mask = enable
|
||||
? (ser->rx_event_mask | interrupt_mask)
|
||||
: (ser->rx_event_mask & ~interrupt_mask);
|
||||
? (cyhal_uart_event_t)(ser->rx_event_mask | interrupt_mask)
|
||||
: (cyhal_uart_event_t)(ser->rx_event_mask & ~interrupt_mask);
|
||||
cyhal_uart_enable_event(&(ser->hal_obj), interrupt_mask, CYHAL_ISR_PRIORITY_DEFAULT, (bool)enable);
|
||||
} else if (irq == TxIrq) {
|
||||
static const cyhal_uart_event_t interrupt_mask = CYHAL_UART_IRQ_TX_DONE | CYHAL_UART_IRQ_TX_ERROR | CYHAL_UART_IRQ_TX_EMPTY;
|
||||
static const cyhal_uart_event_t interrupt_mask = (cyhal_uart_event_t)(CYHAL_UART_IRQ_TX_DONE | CYHAL_UART_IRQ_TX_ERROR | CYHAL_UART_IRQ_TX_EMPTY);
|
||||
ser->tx_event_mask = enable
|
||||
? (cyhal_uart_event_t)(ser->tx_event_mask | interrupt_mask)
|
||||
: (cyhal_uart_event_t)(ser->tx_event_mask & ~interrupt_mask);
|
||||
|
|
Loading…
Reference in New Issue