PER Firmware
Loading...
Searching...
No Matches
main.c File Reference

"Dashboard" node source code More...

#include "main.h"
#include "can_library/faults_common.h"
#include "can_library/generated/DASHBOARD.h"
#include "common/rtos/rtos.h"
#include "common/heartbeat/heartbeat.h"
#include "common/phal_G4/adc/adc.h"
#include "common/phal_G4/fdcan/fdcan.h"
#include "common/phal_G4/gpio/gpio.h"
#include "common/phal_G4/rcc/rcc.h"
#include "common/phal_G4/usart/usart.h"
#include "common/phal_G4/pin_defs/g474ret6.h"
#include "common/utils/countof.h"
#include "common/watchdog/watchdog.h"
#include "driver_interface.h"
#include "lcd.h"
#include "pedals.h"
#include "telemetry.h"
Include dependency graph for main.c:

Functions

void sweep_external_leds ()
 
void service_start_button ()
 
void HardFault_Handler ()
 
void calibrate_LWS ()
 
 DEFINE_CAN_TASKS ()
 
 RTOS_DEFINE_TASK (pedals_periodic, PEDALS_PERIOD_MS, TASK_PRIORITY_HIGH, STACK_1024)
 
 RTOS_DEFINE_TASK (fault_library_periodic, DASHBOARD_FAULT_SYNC_PERIOD_MS, TASK_PRIORITY_NORMAL, STACK_1024)
 
 RTOS_DEFINE_TASK (driver_interface_periodic, DRIVER_INTERFACE_PERIOD_MS, TASK_PRIORITY_LOW, STACK_1024)
 
 RTOS_DEFINE_TASK (report_telemetry_02hz, TELEMETRY_02HZ_PERIOD_MS, TASK_PRIORITY_LOW, STACK_512)
 
 DEFINE_WATCHDOG_TASK ()
 
 DEFINE_HEARTBEAT_TASK (sweep_external_leds)
 
int main (void)
 

Variables

PHAL_GPIO_InitConfig_t gpio_config []
 
static const PHAL_ADC_ChannelConfig_t adc_channels []
 
static const PHAL_ADC_Config_t adc_config
 
volatile raw_adc_values_t raw_adc_values
 
PHAL_ADC_Handle_t adc_handle
 

Detailed Description

Function Documentation

◆ calibrate_LWS()

void calibrate_LWS ( )
Here is the call graph for this function:

◆ DEFINE_CAN_TASKS()

DEFINE_CAN_TASKS ( )

◆ DEFINE_HEARTBEAT_TASK()

DEFINE_HEARTBEAT_TASK ( sweep_external_leds )

◆ DEFINE_WATCHDOG_TASK()

DEFINE_WATCHDOG_TASK ( )

◆ HardFault_Handler()

void HardFault_Handler ( void )
extern

◆ main()

int main ( void )
Here is the call graph for this function:

◆ RTOS_DEFINE_TASK() [1/4]

◆ RTOS_DEFINE_TASK() [2/4]

RTOS_DEFINE_TASK ( fault_library_periodic ,
DASHBOARD_FAULT_SYNC_PERIOD_MS ,
TASK_PRIORITY_NORMAL ,
STACK_1024  )

◆ RTOS_DEFINE_TASK() [3/4]

RTOS_DEFINE_TASK ( pedals_periodic ,
PEDALS_PERIOD_MS ,
TASK_PRIORITY_HIGH ,
STACK_1024  )

◆ RTOS_DEFINE_TASK() [4/4]

◆ service_start_button()

void service_start_button ( )

◆ sweep_external_leds()

void sweep_external_leds ( )
Here is the call graph for this function:

Variable Documentation

◆ adc_channels

const PHAL_ADC_ChannelConfig_t adc_channels[]
static
Initial value:
= {
{.channel = THROTTLE1_ADC_CHANNEL},
{.channel = THROTTLE2_ADC_CHANNEL},
{.channel = REGEN1_ADC_CHANNEL},
{.channel = REGEN2_ADC_CHANNEL},
}
#define THROTTLE1_ADC_CHANNEL
Definition main.h:78
#define BRAKE1_PRESSURE_ADC_CHANNEL
Definition main.h:94
#define REGEN2_ADC_CHANNEL
Definition main.h:89
#define THROTTLE2_ADC_CHANNEL
Definition main.h:81
#define REGEN1_ADC_CHANNEL
Definition main.h:86
#define BRAKE2_PRESSURE_ADC_CHANNEL
Definition main.h:97

◆ adc_config

const PHAL_ADC_Config_t adc_config
static
Initial value:
= {
.instance = ADC1,
.channels = adc_channels,
.channel_count = sizeof(adc_channels) / sizeof(adc_channels[0]),
}
static const PHAL_ADC_ChannelConfig_t adc_channels[]
Definition main.c:65

◆ adc_handle

PHAL_ADC_Handle_t adc_handle

◆ gpio_config

PHAL_GPIO_InitConfig_t gpio_config[]

◆ raw_adc_values

volatile raw_adc_values_t raw_adc_values