F439_CPP_BMP390_Barometric_Pressure_and_Altimeter_01 1.0
STM32F439 BMP390 barometric pressure and altimeter tutorial
Loading...
Searching...
No Matches
main.h File Reference

: Header for main.c file. This file contains the common defines of the application. More...

#include "stm32f4xx_hal.h"

Go to the source code of this file.

Macros

#define Error_Handler()   _Error_Handler((const char *)__FILE__, __LINE__)
 Calls _Error_Handler() with the caller's own file/line.
 
#define REDIRECT_PRINTF
 Routes printf() output over USART1 via __io_putchar() in main.c.
 

Functions

void delayUS (uint16_t us)
 Busy-waits for the given number of microseconds using TIM1 (1 MHz counter – see MX_TIM1_Init()'s prescaler).
 
void _Error_Handler (const char *file, int line)
 Reports a fatal error and halts. See _Error_Handler() in main.c.
 

Detailed Description

: Header for main.c file. This file contains the common defines of the application.

Attention

Copyright (c) 2026 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file main.h.

Macro Definition Documentation

◆ Error_Handler

#define Error_Handler ( )    _Error_Handler((const char *)__FILE__, __LINE__)

Calls _Error_Handler() with the caller's own file/line.

Definition at line 77 of file main.h.

Referenced by MX_I2C1_Init(), MX_TIM1_Init(), MX_USART1_UART_Init(), and SystemClock_Config().

◆ REDIRECT_PRINTF

#define REDIRECT_PRINTF

Routes printf() output over USART1 via __io_putchar() in main.c.

Definition at line 80 of file main.h.

Function Documentation

◆ _Error_Handler()

void _Error_Handler ( const char * file,
int line )

Reports a fatal error and halts. See _Error_Handler() in main.c.

Parameters
fileSource file name where the error occurred.
lineSource line number where the error occurred.

Definition at line 444 of file main.c.

◆ delayUS()

void delayUS ( uint16_t us)

Busy-waits for the given number of microseconds using TIM1 (1 MHz counter – see MX_TIM1_Init()'s prescaler).

Parameters
usNumber of microseconds to wait (0-65535).

Definition at line 109 of file main.c.

References htim1.