From 7039e85ba5e8c28a8712619504f28ba6f4070858 Mon Sep 17 00:00:00 2001 From: Will Hedgecock Date: Mon, 11 Sep 2023 11:25:25 -0500 Subject: [PATCH] Hack antenna changes for RevL --- software/firmware/.settings/language.settings.xml | 2 +- software/firmware/src/boards/revL/pinout.h | 8 ++++---- software/firmware/src/peripherals/src/ranging.c | 14 ++++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/software/firmware/.settings/language.settings.xml b/software/firmware/.settings/language.settings.xml index 7fc2be93..c06145be 100644 --- a/software/firmware/.settings/language.settings.xml +++ b/software/firmware/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + diff --git a/software/firmware/src/boards/revL/pinout.h b/software/firmware/src/boards/revL/pinout.h index d018d5a7..96fb8e4b 100644 --- a/software/firmware/src/boards/revL/pinout.h +++ b/software/firmware/src/boards/revL/pinout.h @@ -45,10 +45,10 @@ #define PIN_IMU_RESET 65 // LEDs -#define PIN_LED1_RED 52 -#define PIN_LED1_GREEN 51 -#define PIN_LED2_RED 76 -#define PIN_LED2_YELLOW 88 +#define PIN_LED1_RED 11 // INCORRECT MAPPING DUE TO SHARED PINS +#define PIN_LED1_GREEN 12 // INCORRECT MAPPING DUE TO SHARED PINS +#define PIN_LED2_RED 15 // INCORRECT MAPPING DUE TO SHARED PINS +#define PIN_LED2_YELLOW 16 // INCORRECT MAPPING DUE TO SHARED PINS // Logging #define PIN_SWO 3 diff --git a/software/firmware/src/peripherals/src/ranging.c b/software/firmware/src/peripherals/src/ranging.c index b2546877..a24f101e 100644 --- a/software/firmware/src/peripherals/src/ranging.c +++ b/software/firmware/src/peripherals/src/ranging.c @@ -148,9 +148,9 @@ void ranging_radio_init(uint8_t *uid) // Set up the DW3000 antenna selection pins configASSERT0(am_hal_gpio_pinconfig(PIN_RADIO_ANTENNA_SELECT1, am_hal_gpio_pincfg_output)); - am_hal_gpio_output_clear(PIN_RADIO_ANTENNA_SELECT1); + am_hal_gpio_output_set(PIN_RADIO_ANTENNA_SELECT1); // TODO: THIS IS INVERTED BECAUSE OF REMAPPING OF PINS OF REVL configASSERT0(am_hal_gpio_pinconfig(PIN_RADIO_ANTENNA_SELECT2, am_hal_gpio_pincfg_output)); - am_hal_gpio_output_clear(PIN_RADIO_ANTENNA_SELECT2); + am_hal_gpio_output_set(PIN_RADIO_ANTENNA_SELECT2); // TODO: THIS IS INVERTED BECAUSE OF REMAPPING OF PINS OF REVL // Set up incoming interrupts from the DW3000 uint32_t radio_interrupt_pin = PIN_RADIO_INTERRUPT; @@ -268,7 +268,7 @@ void ranging_radio_choose_channel(uint8_t channel) void ranging_radio_choose_antenna(uint8_t antenna_number) { // Enable the desired antenna - switch (antenna_number) + /*switch (antenna_number) { case 0: am_hal_gpio_output_clear(PIN_RADIO_ANTENNA_SELECT1); @@ -284,7 +284,8 @@ void ranging_radio_choose_antenna(uint8_t antenna_number) break; default: break; - } + }*/ + // TODO: COMMENTED OUT BECAUSE NO ANTENNA ON REVL } void ranging_radio_disable(void) @@ -296,8 +297,9 @@ void ranging_radio_disable(void) void ranging_radio_sleep(bool deep_sleep) { // Disable all antennas - am_hal_gpio_output_clear(PIN_RADIO_ANTENNA_SELECT1); - am_hal_gpio_output_clear(PIN_RADIO_ANTENNA_SELECT2); + // TODO: COMMENTED OUT BECAUSE NO ANTENNAS ON REVL + //am_hal_gpio_output_clear(PIN_RADIO_ANTENNA_SELECT1); + //am_hal_gpio_output_clear(PIN_RADIO_ANTENNA_SELECT2); // Make sure the radio is disabled and clear the interrupt mask to disable unwanted events dwt_forcetrxoff();