Skip to content

Commit

Permalink
converts tms, demo rtos, fc to new namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
BlakeFreer committed Apr 7, 2024
1 parent bafdd43 commit 2edf5ed
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ void SystemClock_Config();
}

namespace mcal {
periph::DigitalInput button_di{ButtonPin_GPIO_Port, ButtonPin_Pin};
periph::DigitalOutput indicator_do{LedPin_GPIO_Port, LedPin_Pin};
periph::DigitalOutput indicator2_do{LedPin2_GPIO_Port, LedPin2_Pin};
using namespace stm32f767::periph;

DigitalInput button_di{ButtonPin_GPIO_Port, ButtonPin_Pin};
DigitalOutput indicator_do{LedPin_GPIO_Port, LedPin_Pin};
DigitalOutput indicator2_do{LedPin2_GPIO_Port, LedPin2_Pin};
} // namespace mcal

namespace bindings {
Expand Down
10 changes: 6 additions & 4 deletions firmware/projects/DemoProjectRTOS/platforms/stm32f767/os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ extern osTimerId_t messageTimerHandle;
}

namespace mcal {
os::Semaphore sem_test{&testBinarySemaphoreHandle};
os::Mutex mutex_test{&testMutexHandle};
os::Fifo message_queue_test{&myTestQueueHandle};
os::Timer timer_test{&messageTimerHandle};
using namespace stm32f767::os;

Semaphore sem_test{&testBinarySemaphoreHandle};
Mutex mutex_test{&testMutexHandle};
Fifo message_queue_test{&myTestQueueHandle};
Timer timer_test{&messageTimerHandle};
} // namespace mcal

namespace os {
Expand Down
19 changes: 10 additions & 9 deletions firmware/projects/FrontController/platforms/stm32f767/bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
#include "mcal/stm32f767/periph/gpio.h"

namespace mcal {
mcal::periph::DigitalOutput driver_speaker{RTDS_EN_GPIO_Port, RTDS_EN_Pin};
mcal::periph::DigitalOutput brake_light{BRAKE_LIGHT_EN_GPIO_Port,
BRAKE_LIGHT_EN_Pin};
mcal::periph::ADCInput accel_pedal_1{&hadc1, ADC_CHANNEL_10};
mcal::periph::ADCInput accel_pedal_2{&hadc1, ADC_CHANNEL_11};
mcal::periph::ADCInput steering_wheel{&hadc1, ADC_CHANNEL_12};
mcal::periph::ADCInput brake_pedal{&hadc1, ADC_CHANNEL_13};
mcal::periph::DigitalInput driver_button{START_BUTTON_N_GPIO_Port,
START_BUTTON_N_Pin};
using namespace stm32f767::periph;

DigitalOutput driver_speaker{RTDS_EN_GPIO_Port, RTDS_EN_Pin};
DigitalOutput brake_light{BRAKE_LIGHT_EN_GPIO_Port, BRAKE_LIGHT_EN_Pin};
ADCInput accel_pedal_1{&hadc1, ADC_CHANNEL_10};
ADCInput accel_pedal_2{&hadc1, ADC_CHANNEL_11};
ADCInput steering_wheel{&hadc1, ADC_CHANNEL_12};
ADCInput brake_pedal{&hadc1, ADC_CHANNEL_13};
DigitalInput driver_button{START_BUTTON_N_GPIO_Port, START_BUTTON_N_Pin};

} // namespace mcal

extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion firmware/projects/TMS/platforms/stm32f767/bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ void SystemClock_Config();
}

namespace mcal {

using namespace stm32f767::periph;

ADCInput temp_sensor_adc_1{&hadc1, SENS_1_UC_IN_CHANNEL};
ADCInput temp_sensor_adc_2{&hadc1, SENS_2_UC_IN_CHANNEL};
ADCInput temp_sensor_adc_3{&hadc1, SENS_3_UC_IN_CHANNEL};
Expand Down
22 changes: 13 additions & 9 deletions firmware/projects/TMS/platforms/windows/bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@
#include "shared/periph/pwm.h"

namespace mcal {
periph::ADCInput temp_sensor_adc_1{"Temperature Sensor 1"};
periph::ADCInput temp_sensor_adc_2{"Temperature Sensor 2"};
periph::ADCInput temp_sensor_adc_3{"Temperature Sensor 3"};
periph::ADCInput temp_sensor_adc_4{"Temperature Sensor 4"};
periph::ADCInput temp_sensor_adc_5{"Temperature Sensor 5"};
periph::ADCInput temp_sensor_adc_6{"Temperature Sensor 6"};
periph::PWMOutput fan_controller_pwm{"Fan Controller"};
periph::DigitalOutput debug_do_blue{"Debug: Blue"};
periph::DigitalOutput debug_do_red{"Debug: Red"};
using namespace windows::periph;

ADCInput temp_sensor_adc_1{"Temperature Sensor 1"};
ADCInput temp_sensor_adc_2{"Temperature Sensor 2"};
ADCInput temp_sensor_adc_3{"Temperature Sensor 3"};
ADCInput temp_sensor_adc_4{"Temperature Sensor 4"};
ADCInput temp_sensor_adc_5{"Temperature Sensor 5"};
ADCInput temp_sensor_adc_6{"Temperature Sensor 6"};

PWMOutput fan_controller_pwm{"Fan Controller"};
DigitalOutput debug_do_blue{"Debug: Blue"};
DigitalOutput debug_do_red{"Debug: Red"};

} // namespace mcal

namespace bindings {
Expand Down

0 comments on commit 2edf5ed

Please sign in to comment.