I wouldn't assume you get correct behavior by using switch_mode_usb and than toggling USB power later. switch_mode_usb has some side effects too, so it would probably be better to mask the USB power completely.
I guess this means either going back to using set_ config_value(cfg.remote_enable,1) or adding another script function that masks/unmasks the USB bit?
It would be tempting to have something like usb_force_active that took three values: force active, force inactive, leave it alone. Not sure how you'd fit that with the existing functions though.
usb_force_active = 0 : autousb_force_active = 1 : "active"usb_force_active = 2 : "inactive"The current definition will accept false/true or 0/1 so I think this would be backwards compatible Not sure what happens of you feed it a "2" today but its not like this has a ton of naive users (at least not yet).And this is kind of how the set_nd_filter() function works.
Edit 1 : this will also likely require a simple mass edit of kbd.c for ever camera thoughEdit 2 : we currently have CAM_ALLOWS_USB_PORT_FORCING as a platform_camera.h option. I think that was done "out of an abundance of caution" (as the lawyers say). Do we rid of that and build it in for all cameras ?
The meaning of true and false would not be very clear at this point.
I think the main reason was just not wanting to edit all the files.
For the sync stuff, I'd suggest just sticking with set_config_value remote_enable and revisit if / when the keyboard code cleaned up.
QuoteFor the sync stuff, I'd suggest just sticking with set_config_value remote_enable and revisit if / when the keyboard code cleaned up.It would still be nice to clean-up the sync logic and add the usb_sync_wait() function.
I have no idea where to post this - so I'm posting it in the latest related thread.
usb_remote_status_led() in core/usb_remote.c is using hardcoded constants for LED control. This is fine up to (and including) DIGIC 4, but may not work on later DIGICs. To make things difficult, DIGIC 5 ports usually seem to use a "read-modify-write" style direct LED control, so simply defining 2 constants (LED-ON/LED-OFF) may not be enough.
@WW : REMOTE_SYNC_STATUS_LED is defined for the S100, does it work as intended?
Probably a better fit here : USB Remote Switch in CHDK - version 2 implementation thread ?
So we probably need to move the function to the lib.c or kbd.c file in each camera's platform directory?
Quote@WW : REMOTE_SYNC_STATUS_LED is defined for the S100, does it work as intended?Not my port so I've actually never looked. It does not work - the S100 has only one LED (small green one down by the playback button) and an focus assist lamp. Neither illuminate when USB remote sync is enabled and a shot is taken.
Quote from: waterwingz on 03 / July / 2015, 18:50:40Probably a better fit here : USB Remote Switch in CHDK - version 2 implementation thread ?Thanks.Can a mod move these posts please?
QuoteSo we probably need to move the function to the lib.c or kbd.c file in each camera's platform directory?Or we could do it with macros, so the code can stay thumb.
Thanks for checking. The same LED address is used in the port's debug_led() function, in a completely different way, that's why I asked.
Started by RaduP
General Discussion and Assistance
Started by silver88
« 1 2 3 4 »
Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by waterwingz
« 1 2 »
General Discussion and Assistance
Started by TMHKR
General Help and Assistance on using CHDK stable releases
Started by bugbear