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

📄 timers.c

📁 pic18 TIMER INITIALIZATION
💻 C
字号:
/******************************************************************
Modulo per la gestione dei timer software.
******************************************************************/

#include "timers.h"

//*************************
uint16 Date;
uint16 ClockWatch;
//*************************

//*************************
uint8 TimerSw0[N_TSW0] = 0;
uint8 TimerSw1[N_TSW1] = 0;
uint8 TimerSw2[N_TSW2] = 0;
uint8 TimerSw3[N_TSW3] = 0;
//*************************


//************************* 
/*volatile*/ evTSet EvTSet;
//*************************

void WaitTime (uint8 tag) {
	uint8 i = 0;
	do {
		asm("nop");
		i++;
		} while (i < tag);
	}


void TimScheduler (void) {
	//*******************************
	// Inserire codice ad evento 1ms.
	//*******************************
	if (CheckTim(TimDelay1ms)) {
		
		InitTim(TimDelay1ms, 1);
		}

	//********************************
	// Inserire codice ad evento 10ms.
	//********************************
	if (CheckTim(TimDelay10ms)) {
		
		InitTim(TimDelay10ms, 1);
		}
	
	//*********************************
	// Inserire codice ad evento 100ms.
	//*********************************
	if (CheckTim(TimDelay100ms)) {

		InitTim(TimDelay100ms, 1);

		}
	
	//**********************************
	// Inserire codice ad evento 1000ms.
	//**********************************
	if (CheckTim(TimDelay1000ms)) {
		
		ExecStatusDiag (SYNCHRO, NO_FAULT); // Sincronizzazione avvenuta, non 

⌨️ 快捷键说明

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