?? tools.c
字號:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include "tools.h"
volatile unsigned char t1_tick;
unsigned char t1_cnt;
//Konstanten im EEPROM
#define EEPROM __attribute__ ((section (".eeprom")))
//Variablen im EEPROM
EEPROM unsigned char eeprom_sck_period=10;
ISR(SIG_OUTPUT_COMPARE1A)
{
t1_tick=1;
t1_cnt++;
}
unsigned char get_t1_tick(void)
{
if (t1_tick)
{
t1_tick=0;
return 1;
}
return 0;
}
/**
Wartet n*1ms - 1ms max.
*/
void wait_ms(unsigned int n)
{
while (n)
{
if (get_t1_tick()) n--;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -