From 997e99ce03732f1d06f6b733226e6d8a073c5ac0 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Wed, 26 Aug 2015 23:12:05 +0200 Subject: [PATCH] Callback takes two 'l' --- drivers/gpio.c | 30 +++++++++++++++--------------- drivers/rtc.c | 10 +++++----- include/drivers/timers.h | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/gpio.c b/drivers/gpio.c index 72b16cc..3f06c81 100644 --- a/drivers/gpio.c +++ b/drivers/gpio.c @@ -77,9 +77,9 @@ void config_gpio(const struct pio* gpio, uint32_t mode, uint8_t dir, uint8_t ini /***************************************************************************** */ /* GPIO Interrupts Callbacks */ -static void (*gpio_calbacks_port0[PORT0_NB_PINS]) (uint32_t); -static void (*gpio_calbacks_port1[PORT1_NB_PINS]) (uint32_t); -static void (*gpio_calbacks_port2[PORT2_NB_PINS]) (uint32_t); +static void (*gpio_callbacks_port0[PORT0_NB_PINS]) (uint32_t); +static void (*gpio_callbacks_port1[PORT1_NB_PINS]) (uint32_t); +static void (*gpio_callbacks_port2[PORT2_NB_PINS]) (uint32_t); int set_gpio_callback(void (*callback) (uint32_t), const struct pio* gpio, uint8_t sense) { @@ -92,19 +92,19 @@ int set_gpio_callback(void (*callback) (uint32_t), const struct pio* gpio, uint8 case 0: if (gpio->pin >= PORT0_NB_PINS) return -EINVAL; - gpio_calbacks_port0[gpio->pin] = callback; + gpio_callbacks_port0[gpio->pin] = callback; irq = PIO_0_IRQ; break; case 1: if (gpio->pin >= PORT1_NB_PINS) return -EINVAL; - gpio_calbacks_port1[gpio->pin] = callback; + gpio_callbacks_port1[gpio->pin] = callback; irq = PIO_1_IRQ; break; case 2: if (gpio->pin >= PORT2_NB_PINS) return -EINVAL; - gpio_calbacks_port2[gpio->pin] = callback; + gpio_callbacks_port2[gpio->pin] = callback; irq = PIO_2_IRQ; break; default: @@ -156,19 +156,19 @@ void remove_gpio_callback(const struct pio* gpio) case 0: if (gpio->pin >= PORT0_NB_PINS) return; - gpio_calbacks_port0[gpio->pin] = NULL; + gpio_callbacks_port0[gpio->pin] = NULL; irq = PIO_0_IRQ; break; case 1: if (gpio->pin >= PORT1_NB_PINS) return; - gpio_calbacks_port1[gpio->pin] = NULL; + gpio_callbacks_port1[gpio->pin] = NULL; irq = PIO_1_IRQ; break; case 2: if (gpio->pin >= PORT2_NB_PINS) return; - gpio_calbacks_port2[gpio->pin] = NULL; + gpio_callbacks_port2[gpio->pin] = NULL; irq = PIO_2_IRQ; break; default: @@ -197,8 +197,8 @@ void PIO_0_Handler(void) while (status) { if (status & 1) { /* Is there an handler for this one ? */ - if (gpio_calbacks_port0[i] != NULL) { - gpio_calbacks_port0[i](i); + if (gpio_callbacks_port0[i] != NULL) { + gpio_callbacks_port0[i](i); } /* Clear edge detection logic */ gpio0->int_clear |= (1 << i); @@ -217,8 +217,8 @@ void PIO_1_Handler(void) while (status) { if (status & 1) { /* Is there an handler for this one ? */ - if (gpio_calbacks_port1[i] != NULL) { - gpio_calbacks_port1[i](i); + if (gpio_callbacks_port1[i] != NULL) { + gpio_callbacks_port1[i](i); } /* Clear pending interrupt */ gpio1->int_clear |= (1 << i); @@ -237,8 +237,8 @@ void PIO_2_Handler(void) while (status) { if (status & 1) { /* Is there an handler for this one ? */ - if (gpio_calbacks_port2[i] != NULL) { - gpio_calbacks_port2[i](i); + if (gpio_callbacks_port2[i] != NULL) { + gpio_callbacks_port2[i](i); } /* Clear pending interrupt */ gpio2->int_clear |= (1 << i); diff --git a/drivers/rtc.c b/drivers/rtc.c index 747bd57..14ffeef 100644 --- a/drivers/rtc.c +++ b/drivers/rtc.c @@ -149,7 +149,7 @@ int rtc_set_match(uint32_t date, uint32_t offset, uint8_t periodic) } /* RTC Interrupts Callbacks */ -static void (*rtc_calback) (uint32_t); +static void (*rtc_callback) (uint32_t); void setup_callback(uint32_t ticks) { @@ -175,7 +175,7 @@ int set_rtc_callback(void (*callback) (uint32_t), uint32_t when, uint32_t period int ret = 0; /* Register the callback */ - rtc_calback = callback; + rtc_callback = callback; if (rtc_get_count() != 0) { rtc_set_match(when, period, ((period == 0) ? 0 : 1)); } else { @@ -194,7 +194,7 @@ void remove_rtc_callback() struct lpc_rtc* rtc = LPC_RTC; /* Remove the handler */ - rtc_calback = NULL; + rtc_callback = NULL; rtc->intr_control = LPC_RTC_INT_DISABLE; /* And disable the interrupt */ NVIC_DisableIRQ(RTC_IRQ); @@ -205,8 +205,8 @@ void RTC_Handler(void) { struct lpc_rtc* rtc = LPC_RTC; /* Call interrupt handler */ - if (rtc_calback != NULL) { - rtc_calback(rtc->data); + if (rtc_callback != NULL) { + rtc_callback(rtc->data); } rtc->intr_clear = LPC_RTC_CLEAR_INTR; if (periodic_match == 1) { diff --git a/include/drivers/timers.h b/include/drivers/timers.h index 1f3c6ad..dcb4f08 100644 --- a/include/drivers/timers.h +++ b/include/drivers/timers.h @@ -107,7 +107,7 @@ int timer_setup(uint32_t timer_num, const struct timer_config* conf); * for your application as it will be used to divide the main clock to get * the prescaler value. * Set clkrate to 0 to disable the prescaler. - * calback is used for all the possible timer interrupts (activated using the + * callback is used for all the possible timer interrupts (activated using the * config field in timer_config struct upon timer setup) * The interrupt flags are passed to the interrupt routine as argument. */ -- 2.43.0