*/
#define ao_spi_get_mask(reg,mask,bus,speed) do { \
- (reg) &= ~(mask); \
+ (reg) &= (uint8_t) ~(mask); \
} while (0)
#define ao_spi_put_mask(reg,mask,bus) do { \
void
ao_async_stop(void)
{
- LED_PORT &= ~(1 << AO_LED_SERIAL);
+ LED_PORT &= (uint8_t) ~(1 << AO_LED_SERIAL);
}
void
uint8_t bit;
uint8_t w_hi, w_lo;
- /* start data stop */
- w = (0x000 << 0) | (byte << 1) | (0x001 << 9);
+ /* start data stop */
+ w = (uint16_t) ((0x000 << 0) | (byte << 1) | (0x001 << 9));
- w_hi = w >> 8;
- w_lo = w;
+ w_hi = (uint8_t) (w >> 8);
+ w_lo = (uint8_t) w;
ao_arch_block_interrupts();
{
(void) mode;
pcint_callback = callback;
- pcint_mask = (1 << pin);
+ pcint_mask = (uint8_t) (1 << pin);
ao_exti_disable(PORTB, pin);
GIMSK |= (1 << PCIE);
}
#define ao_exti_enable(gpio, pin) (PCMSK |= (1 << (pin)))
-#define ao_exti_disable(gpio, pin) (PCMSK &= ~(1 << (pin)))
+#define ao_exti_disable(gpio, pin) (PCMSK &= (uint8_t) ~(1 << (pin)))
#define ao_exti_init()
void
ao_led_off(uint8_t colors)
{
- LED_PORT &= ~colors;
+ LED_PORT &= (uint8_t) ~colors;
}
void
ao_led_set(uint8_t colors)
{
- LED_PORT = (LED_PORT & ~LEDS_AVAILABLE) | (colors & LEDS_AVAILABLE);
+ LED_PORT = (uint8_t) ((LED_PORT & ~LEDS_AVAILABLE) | (colors & LEDS_AVAILABLE));
}
void
ao_led_toggle(uint8_t colors)
{
- LED_PORT ^= (colors & LEDS_AVAILABLE);
+ LED_PORT = (uint8_t) (LED_PORT ^ (colors & LEDS_AVAILABLE));
}
void
void
ao_led_init(void)
{
- LED_PORT &= ~LEDS_AVAILABLE;
+ LED_PORT &= (uint8_t) ~LEDS_AVAILABLE;
LED_DDR |= LEDS_AVAILABLE;
}
#else
USICR = SPI_USICR_FAST_2;
#endif
- SPI_DIR &= ~(1 << DDB0); /* DI */
+ SPI_DIR &= (uint8_t) ~(1 << DDB0); /* DI */
SPI_DIR |= (1 << DDB1); /* DO */
SPI_DIR |= (1 << DDB2); /* SCLK */
}