📄 reset.h
字号:
/*********************************************************************/
/* Header for Reset/Control library functions */
/*********************************************************************/
#if defined(__dsPIC30F__)
#include <p30fxxxx.h>
#elif defined(__dsPIC33F__)
#include <p33Fxxxx.h>
#elif defined(__PIC24H__)
#include <p24Hxxxx.h>
#endif
#ifndef __RESET_H
#define __RESET_H
/* disable interrupts for the given number of cycles */
#define DisableInterrupts(cycles) __builtin_disi(cycles)
/* macros for POR and BOR resets */
#define PORStatReset RCONbits.POR = 1
#define BORStatReset RCONbits.BOR = 1
/* macros to enable/ disable WDT in software */
#define WDTSWEnable RCONbits.SWDTEN = 1
#define WDTSWDisable RCONbits.SWDTEN = 0
char isMCLR(void) __attribute__ ((section (".libperi"))); /* to check if RESET is due to MCLR */
char isPOR(void) __attribute__ ((section (".libperi"))); /* to check if RESET is due to POR */
char isBOR(void) __attribute__ ((section (".libperi"))); /* to check if RESET is due to BOR */
#ifdef _LVDIF
char isLVD(void) __attribute__ ((section (".libperi"))); /* to check if LVD occured */
#endif
char isWU(void) __attribute__ ((section (".libperi"))); /* to check for the cause of Wakeup from sleep */
char isWDTTO(void) __attribute__ ((section (".libperi"))); /* to check if WDT timeout occured during normal operation */
char isWDTWU(void) __attribute__ ((section (".libperi"))); /* to check if WDT timeout occured during sleep */
#endif /* __RESET_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -