make clean && make
for full rebuilds to avoid stale object filesmake flash
or make program
for deploying to target hardwaremake debug
commands that generate debug symbols (-g flag) and disable optimizations (-O0)make size
to check binary size against flash/RAM constraintscppcheck --enable=all src/
, pc-lint
, or splint
objdump -d
for disassembly analysis and nm
for symbol table inspectionuint8_t
, int16_t
, uint32_t
instead of int
, char
const
keyword extensively for read-only data and function parametersmalloc
, free
) - use static allocationtimer_count
not tc
, sensor_data
not sd
uint8_t status = 0;
volatile
for variables accessed by interrupts or hardware registersflag |= (1 << BIT_POS)
instead of flag += pow(2, BIT_POS)
#define
for constants and bit masks: #define LED_PIN (1 << 5)
#pragma once
in all header files/**
* @brief Initializes the ADC peripheral
* @param[in] channel ADC channel to configure (0-7)
* @param[in] resolution ADC resolution in bits (8, 10, 12)
* @return 0 on success, -1 on error
* @note This function must be called before any ADC operations
* @warning Calling this function disables all ADC interrupts
*/