00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __rom_system_h__
00027 #define __rom_system_h__
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033 #include <sys/irq.h>
00034
00036
00037
00038
00040
00042 extern inline void power_off(void)
00043 {
00044 __asm__ __volatile__("\n\
00045 push r6\n\
00046 bset #7,@0xc4:8 ; software standby mode\n\
00047 jsr @ power_off ; ROM call\n\
00048 pop r6\n\
00049 ");
00050 }
00051
00053
00054 extern inline void power_init(void) {
00055 __asm__ __volatile__("\n\
00056 push r6\n\
00057 jsr @ power_init ; ROM call\n\
00058 bclr #7,@0xc4:8 ; disable software standby\n\
00059 pop r6\n\
00060 ");
00061 }
00062
00064 extern void reset(void) __attribute__((noreturn));
00065
00067 extern inline void rom_reset(void) __attribute__((noreturn));
00068 extern inline void rom_reset(void) {
00069 disable_irqs();
00070 reset();
00071 }
00072
00073 #ifdef __cplusplus
00074 }
00075 #endif
00076
00077 #endif // __rom_system_h__