Mobileread
FBInk: A small tool/library to print crap on your screen!
#211  NiLuJe 01-21-2021, 06:55 PM
Fair warning if your device is already is USBNet mode: Nickel will happily switch to the "Connected" black screen, but will crash and burn a horrible death on *exiting* it ^^.

(Perfectly safe in a stock USBMS state, though).
Reply 

#212  Acorn 01-22-2021, 02:25 PM
Quote NiLuJe
Fair warning if your device is already is USBNet mode: Nickel will happily switch to the "Connected" black screen, but will crash and burn a horrible death on *exiting* it ^^.

(Perfectly safe in a stock USBMS state, though).
Thanks for the heads up!

So, made some progress.. have a chessboard being drawn using calls to fbink_cls for the squares, and fbink_print_raw_data for the pieces extracted from a PNG sprite sheet using PIL.

Also have basic touch input working with libevdev. Didn't realise it even had the ability to "grab" the input built in! Sweet.

What's the deal when it comes to best practice drawing stuff to screen. I'm guessing that ideally you want to only draw stuff to screen that has changed to avoid unnecessary flickering, and that fbink doesn't do anything clever in this regard? Does fbink_cls do something special at a hardware level? Is it more efficient than printing an equivalent image for example?
PXL_20210122_180911255.jpg 
Reply 

#213  NiLuJe 01-22-2021, 03:57 PM
The EPDC itself will do some amount of magic, but, generally, yeah, only repaint/refresh damaged areas.

That's only for *refreshes* though. Painting will always paint .

As far as FBInk is concerned, you can draw without refreshing the screen, which is useful when you have a bunch of small things to draw in a short amount of time that you only really care about displaying at once.

That usually involves setting the no_refresh flag in your FBInkConfig instance, and then doing a manual fbink_refresh call at the end of the batch, with the appropriate region to encompass all your new stuff.
Reply 

#214  Acorn 01-25-2021, 01:39 PM
Is there a way to toggle force_wifi and turn wifi on or off programatically?

Also if force_wifi is on and the device is put to sleep, does the wifi stay on and drain the battery? Or does sleep actually put the whole device to sleep?
Reply 

#215  NiLuJe 01-25-2021, 02:32 PM
@Acorn: NickelDBus can probably do it, I think?

And, yes, force wifi prevents suspend, which will murder a battery in less than an afternoon .
Reply 

#216  Acorn 01-25-2021, 03:45 PM
Yeah, been experiencing that! Turn it on to do some tinkering over SSH and forget to turn it off. Want to find a way to turn it on with a long timeout or something.. or find some other way to make sure internet is kept on, but only while my app is open and active. I guess ideally if you put the device to sleep while my app was running it should turn off wifi and not drain your battery.
Reply 

#217  sherman 01-25-2021, 04:04 PM
Yeah, NickelDBus can do what you want regarding WiFi. Look at wfmConnectWireless and nsForceWifi.

As a bonus, you can also listen for the the various wireless manager signals to know whether or not the connection succeeded (for example wmNetworkConnected).
Reply 

#218  Acorn 01-25-2021, 04:31 PM
Oh awesome, will have a play with that! Any idea how I could make sure force wifi is off when the device is put to sleep? Is there a way to listen for that?
Reply 

#219  sherman 01-25-2021, 04:40 PM
You pass a string to nsForceWifi to enable, disable, or toggle.
Reply 

#220  Acorn 01-25-2021, 05:00 PM
Yep, looking at the examples in the docs I managed to figure that out. Still not sure how to listen for / react to the device going to sleep though.
Reply 

 « First  « Prev Next »  Last »  (22/23)
Today's Posts | Search this Thread | Login | Register