📄 picme.h
字号:
#ifndef _PICME_H
#define _PICME_H
#if defined(_16C57)
#include <pic165x.h>
#endif
#if defined(_16C67)
#include <pic166x.h>
#endif
#if defined(_16F77)
#include <pic16f7x.h>
#endif
#if defined(_16F877)
#include <pic1687x.h>
#endif
#define CLRWDT() asm(" clrwdt")
#define SLEEP() asm(" sleep")
#define ___mkstr1(x) #x
#define ___mkstr(x) ___mkstr1(x)
#define __CONFIG(x) asm("\tpsect config,class=CODE,delta=2");\
asm("\tglobal\tconfig_word"); \
asm("config_word"); \
asm("\tdw "___mkstr(x))
#define __IDLOC(w) asm("\tpsect idloc,class=CODE,delta=2");\
asm("\tglobal\tidloc_word"); \
asm("idloc_word"); \
asm("\tirpc\t__arg," ___mkstr(w)); \
asm("\tdw 0&__arg&h"); \
asm("\tendm")
#define __EEPROM_DATA(a, b, c, d, e, f, g, h) \
asm("\tpsect eeprom_data,class=CODE,delta=2"); \
asm("\tdb\t" ___mkstr(a) "," ___mkstr(b) "," ___mkstr(c) "," ___mkstr(d) "," \
___mkstr(e) "," ___mkstr(f) "," ___mkstr(g) "," ___mkstr(h))
// global interrupt enable macros
#ifdef _PIC16
#ifndef ei
#define ei() (GLINTD = 0) // interrupt disable bit
#endif ei
#ifndef di
#define di() (GLINTD = 1) // interrupt disable bit
#endif di
#elif defined _PIC14
#ifndef ei
#define ei() (GIE = 1) // interrupt enable bit
#endif ei
#ifndef di
#define di() (GIE = 0) // interrupt enable bit
#endif di
#endif
#endif /* _PICME_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -