Reduce function calls by replacing WDT_Reset with macro
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
#define BIT(n) (0x1U << (n))
|
#define BIT(n) (0x1U << (n))
|
||||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||||
#define CLAMP(n, hi, lo) (MIN((hi), MAX((n), (lo))))
|
#define CLAMP(n, hi, lo) MIN((hi), MAX((n), (lo)))
|
||||||
|
|
||||||
void Info(const char *fmt, ...);
|
void Info(const char *fmt, ...);
|
||||||
void Error(const char *fmt, ...);
|
void Error(const char *fmt, ...);
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ void WDT_Disable(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
// See macro in watchdog.h
|
||||||
void WDT_Reset(void)
|
void WDT_Reset(void)
|
||||||
{
|
{
|
||||||
// The WDR – Watchdog Reset – instruction resets the
|
// The WDR – Watchdog Reset – instruction resets the
|
||||||
@@ -118,3 +120,4 @@ void WDT_Reset(void)
|
|||||||
|
|
||||||
__asm__("WDR");
|
__asm__("WDR");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ void WDT_Enable(void);
|
|||||||
void WDT_SetTimeoutFlag(byte flag);
|
void WDT_SetTimeoutFlag(byte flag);
|
||||||
bool WDT_HasTriggered(void);
|
bool WDT_HasTriggered(void);
|
||||||
void WDT_Disable(void);
|
void WDT_Disable(void);
|
||||||
void WDT_Reset(void);
|
|
||||||
|
// Reset watchdog timer instruction
|
||||||
|
#define WDT_Reset() __asm__("WDR")
|
||||||
|
|
||||||
#endif // MAD_CORE_COMMON_WATCHDOG_H
|
#endif // MAD_CORE_COMMON_WATCHDOG_H
|
||||||
|
|||||||
Reference in New Issue
Block a user