#pragma GCC push_options
#pragma GCC optimize ("O0")
#include "stm32c0xx.h"
#include "mySysTick.h"
//Set variables for the ADC
unsigned int inc = 0;
//Set variables to contain the BUS frequencies
void osSystickHandler(void)
{
inc = inc+1;
if(inc==200)
{
GPIOD->ODR ^= (1UL << 2);
inc = 0;
}
}
int main(void)
{
// Enable the GPIOB peripheral
RCC -> IOPENR |= (1UL << 1);
// Configure PB2 to PB9 as output pins
GPIOB ->MODER = 0x55550;
//Enable the GPIOD peripheral
RCC -> IOPENR |= (1UL << 3);
//Configure PD2 as an output pin
GPIOD ->MODER = (1UL << 4);
//Read the BUS frequencies
while (1)
{
//Read the ADC value
//Because STM32C031C6 does not have a Floating Point Unit (FPU) and the "printf"
//function limitations within the context of the embedded environment, floating point
//numbers cannot be printed. Therefore the floating point number has to first be
//converted into a string before being printed via the USART. The function below
//allows for the conversion of the float to a string.
// dtostrf(float_value, min_width, num_digits_after_decimal, where_to_store_string)
//myDelay(1000);
}
}