⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slow_event.c

📁 dspic开发控制程序,有助开发pic单片机程序
💻 C
字号:
 /********************************************************************** 
 *	程序说明
 *  
 *  该文件包含所有的慢速事件处理程序,该事件每100mSec执行一次。
 *  慢速事件包括刷新显示屏,处理按键输入,把系统参数存储到flash内存中。
 *  
 **********************************************************************/

#include "general.h"
#include "hardware.h"
#include "defs.h"
#include "extern_globals.h"

void slow_event_handler(void);

#ifdef DEVELOPMODE
extern void send_run(void);
extern void send_fault(void);
#endif

extern void process_switches(void);

void slow_event_handler(void)
{
	//SLOW_EVENT_RATE在defs.h设为100mSEC
	if (slow_event_count > SLOW_EVENT_RATE) 
	{

		// 反馈值,仅用于显示
		filtered_vdc=(filtered_vdc+vdc)/2;
		filtered_pot=(filtered_pot+pot)/2;
		filtered_rpm=(filtered_rpm+rpm)/2;
		filtered_ibus=(filtered_ibus+ibus)/2;

		process_switches();
		slow_event_count=0;
#ifdef DEVELOPMODE
		if (run_state == FAULT)
			send_fault();
		if (run_state == RUNNING)
			send_run();
#endif
	}
	return;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -