Appears to return 0 until the axp has (presumably) completed
its first real measurement.
Note about erosq: keep the power_inint() delay large to ensure
nothing breaks in the bootloader for the time being.
Change-Id: I444e858207cc401c42f1e6ceacf067ad543d4ff8
Allows user to decide whether scrolling lists will wrap around
to the opposite end after the first or last item has been reached.
Change-Id: I22156812cf4c857ddc4b6c48c1cef013b1985260
handles the folder selection for autoresume paths and database paths
folder_select uses the pluginbuf to build the directory tree
hopefully having it as a plugin will make it stop corrupting
TSR plugins like battery_bench and announce_status
I left the original include and source in the gui directory for now
there are currently no other users..
Change-Id: If40ccb5a2bec4286a0616c10dfa7e1479a592808
Reverts to the behavior pre-commit dfff938 with the additional change
that it will not skip the last entry.
Change-Id: Ia03da03b1bdccd8a9591548cd0ca9f58f4767947
Each time PictureFlow was launched, it would rebuild the
album artwork cache from the beginning.
Depending on the number of albums, this could take a while
and resulted in choppy scrolling.
PictureFlow will now remember how many albums have been
inspected already, and only rescan and write new artwork
when the album index cache gets updated or rebuilt.
Change-Id: Icd78106dacea44b80904ac609caa355cc9113168
- Shortcuts Menu would delete SHORTCUT_TIME shortcuts
when deleting any other shortcut.
- Shortcuts would crash or show wrong number of items
after deleting a shortcut and then launching a shortcut
when simplelist_show_list was executed again.
Change-Id: Ia87c94a364c516fd662cb3c7d245c566a3fa91ca
| with some code refactoring we can eliminate the static
char buffer in get_full_path()
I'm guessing making the functions recursive prompted the static buffer
I don't see any reason we can't just pass the same buffer
|
During tested I noted failure after buffer was full
-- splash added for buffer full notification
added some logic to not add partial entries and try to find a
| selected item that will fit in the remaing buffer
------------------------------------------------------------------------
While looking through the source I noticed a few potential
pitfalls with the current code.
Namely the stack allocated temporary buffer
sized to setting_len.
I also noted the rigid vect[32] with the timeless --
/* 32 separate folders should be Enough For Everybody(TM) */
and decided to make it a bit more robust
The saved items are hashed with crc32 on all the paths
and a hashed_len is kept to aid in the buffer full message before the
user actually goes to save the changes
(assuming they even get the message)
In the old code, buffer might be the same since it ran out of
space and didn't get their later selections
the hashed_len could easily be turned into a way to get a needed buffer
size as well for someone in the future just pass a really large maxlen
I made get_full_path non recursive since it liked to blow the stack
while embedded in all the other recursive calls making it a pain to debug
(the real reason the buffer was static?)
traverse first from the current folder to root mutating the
parent pointers to point at the previous child
next traverse back to the folder unmutating & taking names on the way
Folder depth is now uint16 65535 levels is probably excessive
children_count is also uint16 as well
I made the first folders below root '/' stay below root
instead of shifting since the horizontal real estate is limited
slightly smaller than it began but hopefully faster & more reliable
Change-Id: I348f61baf865cccdeacddfd9d50641a882e890fc
The address from the packet needs to be saved before sending
the response -- after the response the request being pointed
to could get overwritten. This used to be done correctly but
I unintentionally broke it when updating the handler to the
new control request API.
Change-Id: I9b11548baf20dce44a82301731405dc8e8f1cef3
Ive seen no ill effects having this disabled on target so
limit it to the sim to stop Address Sanitizer from dumping
on the extra byte read. the bad data is never used AFAICT
since the loop ends
Change-Id: I8cb54e9d1f8fe28747867d861a015edb3dbfa5ff
Because usb_core_legacy_control_request() is called by an
interrupt handler the global variables used to track the
current control request at the very least need to be volatile.
It might also be necessary to disable IRQs but I'm not sure
of that.
Change-Id: I0f0bb86d0ad63734e8d3c73cb1c52fedf5a98120
save to a .tmp file on save and rename on next load
I think this should pretty minimally invasive as the same file
still gets overwritten in subsequent attempts until it is loaded again
the save path is still static
so it won't cause issues holding up shutdown.
load might be a bit slower with the searching for tmp+current file
and renaming them
Plus there is now a backup of your last settings file
Change-Id: If95618b93a0ba7954d5d8cab1d6ea3f07e658509
we shouldn't need to save the last_screen unless the plugin were to
bypass the normal shutdown procedure
if its a crash do we really want to resume the plugin?
its it is intentional save the settings prior.
Change-Id: I994ed256e7b9e88add0c846825a39b298e2644dd
since the plugin browser now exits before running plugins
it has already loaded the dest data for the plugin
the plugin will be run from the root menu with the open_plugin run key
BUT, since the calls originated from the shortcuts menu
it overwrites the run key with its own
this patch allows the shortcuts menu to overwrite the dest
key as well so it can run the loaded plugin
Change-Id: I63912071d720df01c6fda25d92d9541818e52a43
recent changes broke shortcuts when they originated from the root menu
I mistakenly thought GO_TO_ROOT only happened at start and otherwise was
GO_TO_PREVIOUS
this commit also adds a few missing features for Start In Previous
to resume the last plugin running at shutdown
Additionally GO_TO_ROOT now overwrites the global last_screen so you can
return to the main menu on next startup
Change-Id: I86bf842616e25dc3d4f684ff9d476e6a5ba96b04
The onplay-context was previously not reset when using the playlist
viewer, which led to a bug if onplay() was last called in the context
of the database. If you then tried to insert songs into a dynamic
playlist using the playlist viewer, a selected track from the database
would be picked, instead of one from the displayed playlist, due to
special behavior of add_to_playlist() within the database context.
Change-Id: I727d96fc1bfb2454ed3535959c1b0044ff7d6359
now that the plugin browser is resumable
exit it before running plugins
this causes a problem with the open plugin
shortcuts that call other plugins
but its now handled in count limited loop
so plugins can run plugins in a chain
and overall with less overhead too..
the problem remaining --
the plugin exits on USB, returns to ROOT
the browser resumes the
directory next time you select plugins
making for an unwanted auto return
Change-Id: If401f698207cbae824e95d69a378f13456a5dee4
We have this nice event library laying around probably a few more places
we could use event callbacks
Change-Id: I9180fa9d78788d161f2587110644ca3e08df6f50
So that a “scroll left” button can be repurposed
for returning to the main menu when there is no
existing menu button mapping.
Change-Id: I38515943313f69cc3241b3f523c94ea012471b88
make the plugin browser remember the last item between invocations
this has bugged me for the longest time dealing with the plugin_menu
Fix a very old bug fix for reloading lang strings in the lang menu
FS#8117, sending multiple ENTER_MENU_ITEM callbacks from different
areas of the code makes it hard to keep track of where your callback
is originating
Change-Id: Ib0a61558c11ee4c772134378a7020ac0e10fc4ee
I noticed the way filetree switch was modified
for the lua (and then) opx and open plugin viewers
since builtin files are assumed to be handled in the filetree switch
what if instead filetype_get_plugin() could search the available viewers
this could probably be extended further with selectable defaults
Change-Id: I40f74cd698f4b788a0adcbebf32c08a970df29a5
it makes more sense to make the main buffer static and make the
second (infrequently needed) buffer as stack allocated
Change-Id: Ide7c1a7a312124e47a23ed0ab75a90d7b8be982e
Adding a checksum over the struct offset will allow checking
for compatibility across machines rather than using packed structs
to ensure compability
For any file created by the user from the device this isn't really a concern
But for files between machines, across installs (sim v device),
possibly even across compilers this at least will alert the user
rather than returning junk data
Change-Id: Id0531bbaa7013dce24dece270849f0a10ac99c20
OST timer fix (7a5130a277) causes a boot failure on some units,
the battery voltage reading needs more time to stabilize.
Change-Id: Ic4a9ba90a16fab8ac6d27dbbe7af381f7c810f8f
The battery stabilization delay call seems to need to be
about 170 at minimum now, let's do 190 for safety (+20ms).
Change-Id: Ifd0248891abe827dfcc3e6baf48cc5bef0d0cc1c
It turns out the prescaler fields in OST_CTRL are 2 bits wide,
not 3. The programming manual (as usual) is ambiguous and its
diagram shows 2-bit wide fields, but the bit positions in the
text give a 3-bit wide field. Ingenic's Linux code and my own
testing shows that they are, in fact, 2 bits wide.
This caused the OST2 divisor to be 16 instead of 4; the OST1
divisor was correct. This means that all udelay/mdelay calls
took 4x longer than they should've. After this change the OST2
prescaler will be 4, as intended, and udelay/mdelay calls will
wait for the intended duration.
Change-Id: I2ac0a9190f49b59a840c649bf586131f5f9fde82