2025-09-02 2:24 AM - last edited on 2025-09-02 2:39 AM by Andrew Neil
im looking in the main.h file for this example and wondering where __BUFFER__ is defined thats used in this line
#define COUNTOF(__BUFFER__) (sizeof(__BUFFER__) / sizeof(*(__BUFFER__)))
thanks for the help
2025-09-02 2:33 AM - edited 2025-09-02 2:38 AM
It's just the parameter of the COUNTOF() macro
When you "call" the macro, you replace it with the name of whatever actual buffer you want; eg,
uint8_t my_buffer[123];
size_t buffer_length;
buffer_length = COUNTOF( my_buffer );
This is just standard C syntax - nothing specific to STM32.