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
This boosts USB transfer performance a bit, ~10% for reads and
~25% for writes, for large-ish file transfers. Rockbox is still
around 33-50% slower than the OF.
Change-Id: I236a1e5c69a290c47ed27b70cb2631111fc157ed
When performing an OUT transfer which is not a multiple of the
max packet size, the last packet of the OUT transfer should be
a short packet. However, there's no guarantee the host sends
the expected amount of data in the final packet.
The DWC2 USB controller handles this case by accepting any size
packet and copying it out to memory. So if the packet is bigger
than expected, it'll overrun the caller's buffer and Bad Things
will happen.
The USB 2.0 spec seems to endorse this behavior. Section 8.5.1
says "an ACK handshake indicates the endpoint has space for a
wMaxPacketSize data payload." So it is possible that other USB
controllers share the DWC2's behavior.
The simplest solution is to force all USB RX buffers to be big
enough to hold the transfer size, rounded up to a multiple of
the max packet size. For example, a transfer of 700 bytes would
require a 1024-byte buffer if the MPS = 512 bytes.
Change-Id: Ibb84d2b2d53aec8800a3a7c2449f7a17480acbcf
All existing USB drivers now define USB_LEGACY_CONTROL_API to
enable the emulation layer.
Control request handlers will be ported in follow-up commits.
Change-Id: I4be1ce7c372f2f6fee5978a4858c841b72e77405
On language change Stored plugins may fail to run due
to hashing on lang dependent string
allows searching by langid when the supplied key is LANG_PTR
Fixes error on hash flush where previous entry was not restored
Adds routine to update file in-place (for ATA targets)
Other targets make a temp file to copy entries
breaking changes:
ROCKBOXDIR is no longer hashed since
/.rockbox directory may soon be able to be changed
packed attribute added to op data structure -- oops
Change-Id: Ieead26609559b9c5bdadc6a95227cb2bfbb9f71c
CheckWPS doesn't catch errors involving translated strings
Instead of breaking old themes when the langids no long exist
return "<ERR>"
Change-Id: I0d744cd48bb5a27e735fce3f6f740450d1f6a55a
This makes it possible for macros of conditionally included string
descriptors to get a correct index no matter what other usb drivers
are enabled or disabled due to the nature behavior of enums.
Change-Id: I8ccebbd316605bed0f5d90b6b73fab4a333c02fa