#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))
#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)
#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)
#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;