bme680-air-meter-sw/main.c

28 lines
537 B
C

#include <stm32f0xx.h>
unsigned int i = 0x12345678;
unsigned char c = 2;
#define OUTPUT(pin) (0x01 << (pin * 2))
#define ALTFUNC(pin) ((0x2) << (pin * 2))
#define PINMASK(pin) ((0x3) << (pin * 2))
#define SETAF(PORT,PIN,AF) PORT->AFR[(PIN < 8 ? 0 : 1)] |= AF << ((PIN < 8 ? PIN : (PIN - 8)) * 4)
int main(void) {
RCC->AHBENR |= RCC_AHBENR_GPIOFEN;
GPIOF->MODER |= OUTPUT(0);
GPIOF->ODR |= (1<<0);
SysTick_Config(800000);
while(1) {
i++;
}
}
void SysTick_Handler(void) {
/* Blink bad air LED */
GPIOF->ODR ^= (1<<0);
}