Skip to content

Commit 6f3852d

Browse files
committed
fix 'enumerated type mixed with another type' IAR warnings
1 parent 7817a22 commit 6f3852d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

targets/TARGET_Cypress/TARGET_PSOC6/cy_port_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void port_init(port_t *obj, PortName port, int mask, PinDirection dir)
4141

4242
void port_mode(port_t *obj, PinMode mode)
4343
{
44-
gpio_t gpio = {.pin = 0, .direction = obj->direction, .drive_mode = obj->drive_mode};
44+
gpio_t gpio = {.direction = obj->direction, .drive_mode = obj->drive_mode};
4545
for (uint8_t pin = 0; pin < 8; pin++) {
4646
if ((1 << pin) & obj->mask) {
4747
gpio.pin = port_pin(obj->port, pin);
@@ -52,7 +52,7 @@ void port_mode(port_t *obj, PinMode mode)
5252

5353
void port_dir(port_t *obj, PinDirection dir)
5454
{
55-
gpio_t gpio = {.pin = 0, .direction = obj->direction, .drive_mode = obj->drive_mode};
55+
gpio_t gpio = {.direction = obj->direction, .drive_mode = obj->drive_mode};
5656
for (uint8_t pin = 0; pin < 8; pin++) {
5757
if ((1 << pin) & obj->mask) {
5858
gpio.pin = port_pin(obj->port, pin);

targets/TARGET_Cypress/TARGET_PSOC6/cy_serial_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
151151
static const cyhal_uart_event_t interrupt_mask = (cyhal_uart_event_t)
152152
(CYHAL_UART_IRQ_RX_DONE | CYHAL_UART_IRQ_RX_ERROR | CYHAL_UART_IRQ_RX_NOT_EMPTY);
153153
ser->rx_event_mask = enable
154-
? (ser->rx_event_mask | interrupt_mask)
155-
: (ser->rx_event_mask & ~interrupt_mask);
154+
? (cyhal_uart_event_t)(ser->rx_event_mask | interrupt_mask)
155+
: (cyhal_uart_event_t)(ser->rx_event_mask & ~interrupt_mask);
156156
cyhal_uart_enable_event(&(ser->hal_obj), interrupt_mask, CYHAL_ISR_PRIORITY_DEFAULT, (bool)enable);
157157
} else if (irq == TxIrq) {
158-
static const cyhal_uart_event_t interrupt_mask = CYHAL_UART_IRQ_TX_DONE | CYHAL_UART_IRQ_TX_ERROR | CYHAL_UART_IRQ_TX_EMPTY;
158+
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);
159159
ser->tx_event_mask = enable
160160
? (cyhal_uart_event_t)(ser->tx_event_mask | interrupt_mask)
161161
: (cyhal_uart_event_t)(ser->tx_event_mask & ~interrupt_mask);

0 commit comments

Comments
 (0)