aboutsummaryrefslogtreecommitdiff
path: root/embassy-mspm0/src/gpio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-mspm0/src/gpio.rs')
-rw-r--r--embassy-mspm0/src/gpio.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/embassy-mspm0/src/gpio.rs b/embassy-mspm0/src/gpio.rs
index 13da4f30b..d8eb42dc2 100644
--- a/embassy-mspm0/src/gpio.rs
+++ b/embassy-mspm0/src/gpio.rs
@@ -10,7 +10,7 @@ use embassy_sync::waitqueue::AtomicWaker;
10 10
11use crate::pac::gpio::vals::*; 11use crate::pac::gpio::vals::*;
12use crate::pac::gpio::{self}; 12use crate::pac::gpio::{self};
13#[cfg(all(feature = "rt", any(mspm0c110x, mspm0c1105_c1106, mspm0l110x)))] 13#[cfg(all(feature = "rt", any(gpioa_interrupt, gpiob_interrupt)))]
14use crate::pac::interrupt; 14use crate::pac::interrupt;
15use crate::pac::{self}; 15use crate::pac::{self};
16 16
@@ -1110,16 +1110,21 @@ fn irq_handler(gpio: gpio::Gpio, wakers: &[AtomicWaker; 32]) {
1110 } 1110 }
1111} 1111}
1112 1112
1113#[cfg(all(gpioa_interrupt, gpioa_group))]
1114compile_error!("gpioa_interrupt and gpioa_group are mutually exclusive cfgs");
1115#[cfg(all(gpiob_interrupt, gpiob_group))]
1116compile_error!("gpiob_interrupt and gpiob_group are mutually exclusive cfgs");
1117
1113// C110x and L110x have a dedicated interrupts just for GPIOA. 1118// C110x and L110x have a dedicated interrupts just for GPIOA.
1114// 1119//
1115// These chips do not have a GROUP1 interrupt. 1120// These chips do not have a GROUP1 interrupt.
1116#[cfg(all(feature = "rt", any(mspm0c110x, mspm0c1105_c1106, mspm0l110x)))] 1121#[cfg(all(feature = "rt", gpioa_interrupt))]
1117#[interrupt] 1122#[interrupt]
1118fn GPIOA() { 1123fn GPIOA() {
1119 irq_handler(pac::GPIOA, &PORTA_WAKERS); 1124 irq_handler(pac::GPIOA, &PORTA_WAKERS);
1120} 1125}
1121 1126
1122#[cfg(all(feature = "rt", mspm0c1105_c1106))] 1127#[cfg(all(feature = "rt", gpiob_interrupt))]
1123#[interrupt] 1128#[interrupt]
1124fn GPIOB() { 1129fn GPIOB() {
1125 irq_handler(pac::GPIOB, &PORTB_WAKERS); 1130 irq_handler(pac::GPIOB, &PORTB_WAKERS);
@@ -1129,21 +1134,21 @@ fn GPIOB() {
1129// 1134//
1130// Defining these as no_mangle is required so that the linker will pick these over the default handler. 1135// Defining these as no_mangle is required so that the linker will pick these over the default handler.
1131 1136
1132#[cfg(all(feature = "rt", not(any(mspm0c110x, mspm0c1105_c1106, mspm0l110x))))] 1137#[cfg(all(feature = "rt", gpioa_group))]
1133#[unsafe(no_mangle)] 1138#[unsafe(no_mangle)]
1134#[allow(non_snake_case)] 1139#[allow(non_snake_case)]
1135fn GPIOA() { 1140fn GPIOA() {
1136 irq_handler(pac::GPIOA, &PORTA_WAKERS); 1141 irq_handler(pac::GPIOA, &PORTA_WAKERS);
1137} 1142}
1138 1143
1139#[cfg(all(feature = "rt", gpio_pb, not(mspm0c1105_c1106)))] 1144#[cfg(all(feature = "rt", gpiob_group))]
1140#[unsafe(no_mangle)] 1145#[unsafe(no_mangle)]
1141#[allow(non_snake_case)] 1146#[allow(non_snake_case)]
1142fn GPIOB() { 1147fn GPIOB() {
1143 irq_handler(pac::GPIOB, &PORTB_WAKERS); 1148 irq_handler(pac::GPIOB, &PORTB_WAKERS);
1144} 1149}
1145 1150
1146#[cfg(all(feature = "rt", gpio_pc))] 1151#[cfg(all(feature = "rt", gpioc_group))]
1147#[allow(non_snake_case)] 1152#[allow(non_snake_case)]
1148#[unsafe(no_mangle)] 1153#[unsafe(no_mangle)]
1149fn GPIOC() { 1154fn GPIOC() {