All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Login


All New Login

All gists matching topic stm32

Recently created
Least recently created
Recently updated
Least recently updated

PowLu / 嵌入式C非阻塞周期执行宏

0 likes
0 forks
2 files
Last active 1776395259
一个轻量级、可移植的C宏,用于按固定时间间隔执行代码,不阻塞主循环。适用于裸机STM32或FreeRTOS等嵌入式项目。
c embedded freertos macro stm32
1 // 例1:每500ms翻转一次LED
2 void main_loop(void) {
3 RUN_EVERY(500, led_tick, {
4 HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
5 });
6
7 // 其他非阻塞任务
8 read_sensor();
9 process_data();
10 }

PowLu / Freertos获取任务运行态参数

0 likes
0 forks
2 files
Last active 1776394742
获取任务运行时间、运行计数、栈占用
c embedded freertos stm32
1 /**
2 ******************************************************************************
3 * @file user\global\g_runtime.c
4 * @author luhuaishuai
5 * @version v0.1
6 * @date 2026-1-12
7 * @brief Briefly describe the function of your function
8 ******************************************************************************
9 */
Newer Older

Powered by Opengist ⋅ Load: 18ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文