Reduce function calls by replacing WDT_Reset with macro

This commit is contained in:
2024-09-30 16:53:08 +02:00
parent 730f09d060
commit e323ef4783
3 changed files with 7 additions and 2 deletions

View File

@@ -14,7 +14,7 @@
#define BIT(n) (0x1U << (n))
#define MIN(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 Error(const char *fmt, ...);

View File

@@ -106,6 +106,8 @@ void WDT_Disable(void)
}
}
/*
// See macro in watchdog.h
void WDT_Reset(void)
{
// The WDR Watchdog Reset instruction resets the
@@ -118,3 +120,4 @@ void WDT_Reset(void)
__asm__("WDR");
}
*/

View File

@@ -17,6 +17,8 @@ void WDT_Enable(void);
void WDT_SetTimeoutFlag(byte flag);
bool WDT_HasTriggered(void);
void WDT_Disable(void);
void WDT_Reset(void);
// Reset watchdog timer instruction
#define WDT_Reset() __asm__("WDR")
#endif // MAD_CORE_COMMON_WATCHDOG_H