From 5cac36d5b36addd81127d7ed41a436cb14554827 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Mon, 8 Feb 2016 16:45:45 +0100 Subject: [PATCH 1/2] cpu/kinetis_common: moved drivers to periph subdir --- cpu/kinetis_common/Makefile | 2 ++ cpu/kinetis_common/periph/Makefile | 3 +++ cpu/kinetis_common/{ => periph}/adc.c | 0 cpu/kinetis_common/{ => periph}/cpuid.c | 0 cpu/kinetis_common/{ => periph}/gpio.c | 0 cpu/kinetis_common/{ => periph}/i2c.c | 0 cpu/kinetis_common/{ => periph}/mcg.c | 0 cpu/kinetis_common/{ => periph}/pwm.c | 0 cpu/kinetis_common/{ => periph}/random_rnga.c | 0 cpu/kinetis_common/{ => periph}/random_rngb.c | 0 cpu/kinetis_common/{ => periph}/rtc.c | 0 cpu/kinetis_common/{ => periph}/rtt.c | 0 cpu/kinetis_common/{ => periph}/spi.c | 0 cpu/kinetis_common/{ => periph}/timer.c | 0 cpu/kinetis_common/{ => periph}/uart.c | 0 cpu/kinetis_common/{ => periph}/wdog.c | 0 16 files changed, 5 insertions(+) create mode 100644 cpu/kinetis_common/periph/Makefile rename cpu/kinetis_common/{ => periph}/adc.c (100%) rename cpu/kinetis_common/{ => periph}/cpuid.c (100%) rename cpu/kinetis_common/{ => periph}/gpio.c (100%) rename cpu/kinetis_common/{ => periph}/i2c.c (100%) rename cpu/kinetis_common/{ => periph}/mcg.c (100%) rename cpu/kinetis_common/{ => periph}/pwm.c (100%) rename cpu/kinetis_common/{ => periph}/random_rnga.c (100%) rename cpu/kinetis_common/{ => periph}/random_rngb.c (100%) rename cpu/kinetis_common/{ => periph}/rtc.c (100%) rename cpu/kinetis_common/{ => periph}/rtt.c (100%) rename cpu/kinetis_common/{ => periph}/spi.c (100%) rename cpu/kinetis_common/{ => periph}/timer.c (100%) rename cpu/kinetis_common/{ => periph}/uart.c (100%) rename cpu/kinetis_common/{ => periph}/wdog.c (100%) diff --git a/cpu/kinetis_common/Makefile b/cpu/kinetis_common/Makefile index 587f1a4038..503d148876 100644 --- a/cpu/kinetis_common/Makefile +++ b/cpu/kinetis_common/Makefile @@ -1,4 +1,6 @@ # define the module that is build MODULE = kinetis_common +DIRS += periph + include $(RIOTBASE)/Makefile.base diff --git a/cpu/kinetis_common/periph/Makefile b/cpu/kinetis_common/periph/Makefile new file mode 100644 index 0000000000..6d1887b640 --- /dev/null +++ b/cpu/kinetis_common/periph/Makefile @@ -0,0 +1,3 @@ +MODULE = periph + +include $(RIOTBASE)/Makefile.base diff --git a/cpu/kinetis_common/adc.c b/cpu/kinetis_common/periph/adc.c similarity index 100% rename from cpu/kinetis_common/adc.c rename to cpu/kinetis_common/periph/adc.c diff --git a/cpu/kinetis_common/cpuid.c b/cpu/kinetis_common/periph/cpuid.c similarity index 100% rename from cpu/kinetis_common/cpuid.c rename to cpu/kinetis_common/periph/cpuid.c diff --git a/cpu/kinetis_common/gpio.c b/cpu/kinetis_common/periph/gpio.c similarity index 100% rename from cpu/kinetis_common/gpio.c rename to cpu/kinetis_common/periph/gpio.c diff --git a/cpu/kinetis_common/i2c.c b/cpu/kinetis_common/periph/i2c.c similarity index 100% rename from cpu/kinetis_common/i2c.c rename to cpu/kinetis_common/periph/i2c.c diff --git a/cpu/kinetis_common/mcg.c b/cpu/kinetis_common/periph/mcg.c similarity index 100% rename from cpu/kinetis_common/mcg.c rename to cpu/kinetis_common/periph/mcg.c diff --git a/cpu/kinetis_common/pwm.c b/cpu/kinetis_common/periph/pwm.c similarity index 100% rename from cpu/kinetis_common/pwm.c rename to cpu/kinetis_common/periph/pwm.c diff --git a/cpu/kinetis_common/random_rnga.c b/cpu/kinetis_common/periph/random_rnga.c similarity index 100% rename from cpu/kinetis_common/random_rnga.c rename to cpu/kinetis_common/periph/random_rnga.c diff --git a/cpu/kinetis_common/random_rngb.c b/cpu/kinetis_common/periph/random_rngb.c similarity index 100% rename from cpu/kinetis_common/random_rngb.c rename to cpu/kinetis_common/periph/random_rngb.c diff --git a/cpu/kinetis_common/rtc.c b/cpu/kinetis_common/periph/rtc.c similarity index 100% rename from cpu/kinetis_common/rtc.c rename to cpu/kinetis_common/periph/rtc.c diff --git a/cpu/kinetis_common/rtt.c b/cpu/kinetis_common/periph/rtt.c similarity index 100% rename from cpu/kinetis_common/rtt.c rename to cpu/kinetis_common/periph/rtt.c diff --git a/cpu/kinetis_common/spi.c b/cpu/kinetis_common/periph/spi.c similarity index 100% rename from cpu/kinetis_common/spi.c rename to cpu/kinetis_common/periph/spi.c diff --git a/cpu/kinetis_common/timer.c b/cpu/kinetis_common/periph/timer.c similarity index 100% rename from cpu/kinetis_common/timer.c rename to cpu/kinetis_common/periph/timer.c diff --git a/cpu/kinetis_common/uart.c b/cpu/kinetis_common/periph/uart.c similarity index 100% rename from cpu/kinetis_common/uart.c rename to cpu/kinetis_common/periph/uart.c diff --git a/cpu/kinetis_common/wdog.c b/cpu/kinetis_common/periph/wdog.c similarity index 100% rename from cpu/kinetis_common/wdog.c rename to cpu/kinetis_common/periph/wdog.c From cfcf951b9d16fcece8b28abe0dc19c0e2cbd0bba Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Tue, 9 Feb 2016 16:22:25 +0100 Subject: [PATCH 2/2] cpu/kinetis_common: fixed null ptr ref in gpio.c --- cpu/kinetis_common/periph/gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/kinetis_common/periph/gpio.c b/cpu/kinetis_common/periph/gpio.c index 6407fd6c64..e612d7c482 100644 --- a/cpu/kinetis_common/periph/gpio.c +++ b/cpu/kinetis_common/periph/gpio.c @@ -326,12 +326,12 @@ void gpio_irq_enable(gpio_t dev) mutex_lock(&int_config_lock); /* Search for the given pin in the port's interrupt configuration */ LL_SEARCH_SCALAR(gpio_interrupts[_port_num(dev)], entry, pin, pin_number); - uint32_t irqc = entry->irqc; mutex_unlock(&int_config_lock); if (entry == NULL) { /* Pin has not been configured for interrupts */ return; } + uint32_t irqc = entry->irqc; port->PCR[pin_number] &= ~(PORT_PCR_IRQC_MASK); port->PCR[pin_number] |= irqc; }