Index: core/main.c===================================================================--- core/main.c (revision 3343)+++ core/main.c (working copy)@@ -189,6 +189,8 @@ } shooting_init();+ extern void init_timer_demo();+ init_timer_demo(); while (1) {@@ -249,10 +251,11 @@ i = 0; -#ifdef DEBUG_PRINT_TO_LCD- sprintf(osd_buf, "%d", cnt ); // modify cnt to what you want to display+//#ifdef DEBUG_PRINT_TO_LCD+ extern int hmmm, hmmmm;+ sprintf(osd_buf, "%x, %x", hmmm, hmmmm ); // modify cnt to what you want to display draw_txt_string(1, i++, osd_buf, conf.osd_color);-#endif+//#endif if (camera_info.perf.md_af_tuning) {Index: platform/a3200/sub/100d/stubs_entry_2.S===================================================================--- platform/a3200/sub/100d/stubs_entry_2.S (revision 3343)+++ platform/a3200/sub/100d/stubs_entry_2.S (working copy)@@ -12,3 +12,10 @@ NHSTUB(TurnOnMic, 0xFF8608E8) NHSTUB(TurnOffMic, 0xFF860914) NHSTUB(TurnOffE1, 0xff83bc20)++NHSTUB(SetTimerAfter, 0xff83aa4c)+NHSTUB(SetTimerWhen, 0xff83aacc)+NHSTUB(CancelTimer, 0xff83ab30)+NHSTUB(SetHPTimerAfterNow, 0xff888770)+NHSTUB(SetHPTimerAfterTimeout, 0xff8887f0)+NHSTUB(CancelHPTimer, 0xff888878)Index: platform/generic/lib.c===================================================================--- platform/generic/lib.c (revision 3343)+++ platform/generic/lib.c (working copy)@@ -1 +1,2 @@ #include "platform.h"+Index: platform/generic/wrappers.c===================================================================--- platform/generic/wrappers.c (revision 3343)+++ platform/generic/wrappers.c (working copy)@@ -1677,3 +1677,37 @@ return (conf.remote_enable == 0 && get_usb_bit()); } +// timer demo++extern int _SetTimerAfter(int delay, int(*good_cb)(int, int), int(*bad_cb)(int, int), int whatever);+extern int _SetTimerWhen(int time, int(*good_cb)(int, int), int(*bad_cb)(int, int), int whatever);+extern int _CancelTimer(int);++static int blinkcnt = 0;+static int blinkdly = 4096;+static int demostate = 1;+int hmmm = 0;+int hmmmm = 0;++int mytimerfunc(int a, int b) {+ hmmmm = a;+ hmmm = b;+ blinkcnt--;+ if (blinkcnt>0) {+ _SetTimerAfter(blinkdly,mytimerfunc,mytimerfunc,(int)&hmmm);+ }+ else {+ void init_timer_demo();+ init_timer_demo();+ }+ blinkdly>>=1;+ debug_led(demostate);+ demostate = !demostate;+ return 0;+}+void init_timer_demo() {+ blinkcnt = 8;+ blinkdly = 1024;+ _SetTimerWhen(get_tick_count()+10000,mytimerfunc,mytimerfunc,(int)&hmmm);+}+
HP timer functions, they use a 20 bit hw counter, retrieved by GetCurrentMachineTime() aka *(int*)0xc0242014
They can probably be thumb on DryOS, but most probably need to be ARM on VxWorks.
Quote from: srsa_4c on 28 / January / 2014, 17:15:32They can probably be thumb on DryOS, but most probably need to be ARM on VxWorks.Trying to understand how to make a common callback handler for all camera OS's.
I would have thought thumb code should work in both cases, although I haven't looked at the VxWorks firmware functions. I would expect the firmware code is loading the callback address into a register and doing a 'BL Rn' instruction - so the CPU should take care of mode switching based on the low bit of the address.
I would have thought thumb code should work in both cases, although I haven't looked at the VxWorks firmware functions.I would expect the firmware code is loading the callback address into a register and doing a 'BL Rn' instruction - so the CPU should take care of mode switching based on the low bit of the address.
Quote from: srsa_4c on 28 / January / 2014, 17:15:32HP timer functions, they use a 20 bit hw counter, retrieved by GetCurrentMachineTime() aka *(int*)0xc0242014So far this is only defined for a couple of cameras.
Quote from: philmoz on 23 / March / 2014, 18:03:32I would have thought thumb code should work in both cases, although I haven't looked at the VxWorks firmware functions.I would expect the firmware code is loading the callback address into a register and doing a 'BL Rn' instruction - so the CPU should take care of mode switching based on the low bit of the address.Unfortunately, the code is like this:NSTUB(SetHPTimerAfterNow, 0xffc056d8):ffc056d8: push {r4, r5, r6, r7, lr}ffc056dc: ldr r12, =0x1db0ffc056e0: ldr lr, [r12]ffc056e4: cmp lr, #0ffc056e8: mov r6, r0ffc056ec: mov r5, r3ffc056f0: mov r0, #23ffc056f4: mov r4, r1ffc056f8: mov r7, r2ffc056fc: popne {r4, r5, r6, r7, pc}ffc05700: bl GetCurrentMachineTimeffc05704: mov r1, r4ffc05708: add r4, r0, r6ffc0570c: bic r4, r4, #0xff000000ffc05710: bic r4, r4, #0xf00000ffc05714: cmp r6, #0ffc05718: mov r2, r5ffc0571c: mov r0, r4ffc05720: bne ffc05738ffc05724: mov r1, r5ffc05728: mov lr, pcffc0572c: mov pc, r7As far as I know, there is no thumb/ARM mode switch on MOV.
I can suggest two approaches:- put all the callback code in wrappers.c so it is always compiled as ARM- put an ARM wrapper for the callback code in wrappers.c with the main thumb code in the usb_remote fileIf the callback function is simple then it can probably live in wrappers.c, otherwise the second option is probably better.
Started by fudgey General Discussion and Assistance
Started by reyalp General Discussion and Assistance
Started by flarn2006 Feature Requests
Started by ccanon Feature Requests
Started by waterwingz « 1 2 ... 6 7 » General Discussion and Assistance