Open FFBoard
Open source force feedback firmware
cppmain.cpp File Reference

Go to the source code of this file.

Functions

FFBoardMain *mainclass __attribute__ ((section(CCRAM_SEC)))
 
void cppmain ()
 
void refreshWatchdog ()
 
uint32_t micros ()
 
void * malloc (size_t size)
 
void free (void *p)
 
unsigned long getRunTimeCounterValue (void)
 

Variables

uint32_t clkmhz = HAL_RCC_GetHCLKFreq() / 100000
 
IWDG_HandleTypeDef hiwdg
 
bool running = true
 
bool mainclassChosen = false
 
uint16_t main_id = 0
 
ClassChooser< FFBoardMainmainchooser (class_registry)
 
StackType_t usb_device_stack [USBD_STACK_SIZE]
 
StaticTask_t usb_device_taskdef
 

Function Documentation

◆ __attribute__()

FFBoardMain *mainclass __attribute__ ( (section(CCRAM_SEC))  )

◆ cppmain()

void cppmain ( )

Firmware is not intended for this chip! This can be caused by accidentially flashing an incorrect firmware file and likely screws up clock and pin configs Do not proceed.

Definition at line 30 of file cppmain.cpp.

◆ free()

void free ( void *  p)

Definition at line 135 of file cppmain.cpp.

◆ getRunTimeCounterValue()

unsigned long getRunTimeCounterValue ( void  )

Helper function for RTOS run time measurements Should return a reasonably accurate and large counter value

Definition at line 144 of file cppmain.cpp.

◆ malloc()

void * malloc ( size_t  size)

Definition at line 130 of file cppmain.cpp.

◆ micros()

uint32_t micros ( )

TIM_MICROS_HALTICK MUST be reset by the HAL tick OR be the same tick timer to count microseconds since last tick update. By default ST HAL initializes the tick timer with 1MHz and 1kHz overrun interrupts so TIM_MICROS_HALTICK can be defined as that timer. Alternatively an actual freerunning 32b can be defined as TIM_MICROS to use its count directly. Otherwise the cyclecounter is used.

Definition at line 116 of file cppmain.cpp.

◆ refreshWatchdog()

void refreshWatchdog ( )

Definition at line 103 of file cppmain.cpp.

Variable Documentation

◆ clkmhz

uint32_t clkmhz = HAL_RCC_GetHCLKFreq() / 100000

Definition at line 10 of file cppmain.cpp.

◆ hiwdg

IWDG_HandleTypeDef hiwdg
extern

◆ main_id

uint16_t main_id = 0

Definition at line 19 of file cppmain.cpp.

◆ mainchooser

◆ mainclassChosen

bool mainclassChosen = false

Definition at line 17 of file cppmain.cpp.

◆ running

bool running = true

Definition at line 16 of file cppmain.cpp.

◆ usb_device_stack

StackType_t usb_device_stack[USBD_STACK_SIZE]

Definition at line 26 of file cppmain.cpp.

◆ usb_device_taskdef

StaticTask_t usb_device_taskdef

Definition at line 27 of file cppmain.cpp.