Skip to content

Commit

Permalink
Hack antenna changes for RevL
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgecrw committed Sep 11, 2023
1 parent f753024 commit 7039e85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion software/firmware/.settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1349187344451287604" id="org.eclipse.embedcdt.managedbuild.cross.arm.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Arm Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1424646437403787802" id="org.eclipse.embedcdt.managedbuild.cross.arm.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Arm Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} ${cross_toolchain_flags} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
8 changes: 4 additions & 4 deletions software/firmware/src/boards/revL/pinout.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions software/firmware/src/peripherals/src/ranging.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand All @@ -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();
Expand Down

0 comments on commit 7039e85

Please sign in to comment.