altos/lpc: Add casts to reduce -Wconversion warnings
[fw/altos] / src / lpc / ao_arch_funcs.h
index 1368f7e5e883ad4b8c94adf626d9d85db7657b67..e88b0141f9ad7c37ea8785e448d9a59411b142f7 100644 (file)
@@ -23,7 +23,7 @@
 #define ao_spi_put_bit(reg,bit,bus) ao_spi_put_mask(reg,(1<<bit),bus)
 
 #define ao_enable_port(port) (lpc_scb.sysahbclkctrl |= (1 << LPC_SCB_SYSAHBCLKCTRL_GPIO))
-#define ao_disable_port(port) (lpc_scb.sysahbclkctrl &= ~(1 << LPC_SCB_SYSAHBCLKCTRL_GPIO))
+#define ao_disable_port(port) (lpc_scb.sysahbclkctrl &= ~(1UL << LPC_SCB_SYSAHBCLKCTRL_GPIO))
 
 #define lpc_all_bit(port,bit)  (((port) << 5) | (bit))
 
@@ -65,7 +65,7 @@ static inline void lpc_set_gpio(int port, int bit) {
 #define ao_enable_input(port,bit,mode) do {                            \
                ao_enable_port(port);                                   \
                lpc_set_gpio(port,bit);                                 \
-               lpc_gpio.dir[port] &= ~(1 << bit);                      \
+               lpc_gpio.dir[port] &= ~(1UL << bit);                    \
                ao_gpio_set_mode(port,bit,mode);                        \
        } while (0)
 
@@ -80,7 +80,7 @@ static inline void lpc_set_gpio(int port, int bit) {
 
 #define ao_enable_analog(port,bit,id) do {                             \
                ao_enable_port(port);                                   \
-               lpc_gpio.dir[port] &= ~(1 << bit);                      \
+               lpc_gpio.dir[port] &= ~(1UL << bit);                    \
                lpc_ioconf.analog_reg(port,bit) = ((analog_func(id) << LPC_IOCONF_FUNC) | \
                                                   (0 << LPC_IOCONF_ADMODE)); \
        } while (0)
@@ -107,9 +107,8 @@ ao_arch_memory_barrier(void) {
 
 #if HAS_TASK
 static inline void
-ao_arch_init_stack(struct ao_task *task, void *start)
+ao_arch_init_stack(struct ao_task *task, uint32_t *sp, void *start)
 {
-       uint32_t        *sp = &task->stack32[AO_STACK_SIZE >> 2];
        uint32_t        a = (uint32_t) start;
        int             i;