void DisableInterrupts(){ asm( "MRS R1, CPSR\n" "AND R0, R1, #0x80\n" "ORR R1, R1, #0x80\n" "MSR CPSR_cf, R1\n" :::"r1","r0");}void __attribute__((noreturn)) Restart();void __attribute__((noreturn)) shutdown(){ volatile long *p = (void*)0xc02200a0; DisableInterrupts(); *p = 0x44; while(1);}/*int GetPhysicalSwitchRAW(int key){ volatile long *p = (void*)(0xc0220000 + (key&0xffff)); return *p;}*/void idle(){ int i; for(i=0;i<0x78800;i++){ asm ("nop\n"); asm ("nop\n"); asm ("nop\n"); asm ("nop\n"); }}#define LED_AF 0xc0220080#define LED_PR 0xc0220084void led_on(){ volatile long *p=(void*)LED_PR; *p=0x46;}void led_off(){ volatile long *p=(void*)LED_PR; *p=0x44;}void panic(){ volatile long *p=(void*)LED_PR; p[0]=0x46; idle(); shutdown();}int main(){ volatile long *p; long i, b, t, r, j; idle(); p=(void*)0xc02200e0; *p=0x46; idle(); //shutdown();}
for(p=(void*)0xc0220080;p<0xc02200ff;p++){ *p=0x46; }
How long will it take?
I get these sync errors again, and two fails, but why? light conditions didn't change, ...
Started by Gregory Feature Requests
Started by srsa_4c CHDK Releases