Commit Graph

35717 Commits

Author SHA1 Message Date
Nico 74ea93a708 Merge branch 'master' into varvara 2021-11-04 19:57:05 +00:00
Christian Soffke 22c2e0a7c2 Fix: Reset onplay-context for playlist viewer
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
2021-11-03 13:28:10 -04:00
Solomon Peachy 5e663f0420 xduoox3ii: Ignore the remote events when headphones aren't plugged in
This prevents the actual insertion/removal from triggering false events

Change-Id: I54114ce903e110c31eca6b2ce258a0cf5f6b782b
2021-11-03 13:16:40 -04:00
Nico eea3932a3d initial controller support. needs work 2021-11-02 11:36:30 +00:00
Nico 073fb10abb revert to old method of graphics 2021-11-02 10:47:49 +00:00
William Wilgus 2731144094 exit file browser before running plugins
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
2021-10-31 21:49:31 -04:00
William Wilgus 684565b8f3 USB fix red for device without HAVE_USB_POWER again.
Change-Id: I3122d532cbb8d5b5cb9040f08707c1514bc1b18e
2021-10-31 21:36:21 -04:00
William Wilgus d72a0ed65d Use USB events for storing plugin_menu state
use usb connected callback to cancel menu reentry after USB plug/unplug

Change-Id: I8267deed6e8ada94ca527392f56f50ef22def1d7
2021-10-31 12:42:24 -04:00
William Wilgus 7a6737f471 USB Events fix red on devices without HAVE_USB_POWER
Change-Id: I112e6379d4bed019d7e047e5802f104e250d926e
2021-10-31 12:30:27 -04:00
William Wilgus 894a9d9063 USB add Insertion and Extraction callback events
We have this nice event library laying around probably a few more places
we could use event callbacks

Change-Id: I9180fa9d78788d161f2587110644ca3e08df6f50
2021-10-31 12:02:38 -04:00
Nico 90be393276 Merge branch 'master' into varvara 2021-10-30 19:09:37 +01:00
Nico 23dd0c0e59 cleanup 2021-10-30 19:08:31 +01:00
Nico 16fa1f1990 ignore varvara roms 2021-10-30 19:07:57 +01:00
Nico 8b022f1a27 initial g 2021-10-30 19:07:46 +01:00
Christian Soffke 0b1c05db40 Have ACTION_TREE_ROOT_INIT cause ACTION_STD_MENU
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
2021-10-30 01:20:35 +02:00
Christian Soffke 139d447c6a fiiom3k: Modified keymap
see https://forums.rockbox.org/index.php/topic,52917.msg249425.html#msg249425

Change-Id: I8944434c5a840d0d2e35b9591dd72334430b8b09
2021-10-30 01:07:00 +02:00
Nico e051ac2c48 add screen vector and first test program 2021-10-29 09:03:45 +01:00
William Wilgus dc24a18cef PLUGINBROWSER make resumable
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
2021-10-29 03:07:42 -04:00
Nico ab47d5974a get initial screen implementation mostly working. 2021-10-28 22:15:56 +01:00
Nico 73688d2e96 it's broken but I'm trying 2021-10-28 21:26:36 +01:00
Nico 4c679e8ac5 initial work on varvara plugin 2021-10-28 18:21:27 +01:00
William Wilgus 8ee24d8cb4 onplay calls plugins to run other plugins
Change-Id: I7c1593c93debc0ac5c0f1b2e839ec0eb1bd375b7
2021-10-27 22:44:35 -04:00
William Wilgus f1ef5ab8a6 menu.c do_menu code cleanup
no functional changes here just removal of cruft

Change-Id: Id16c3607608d8f1ddcaf219dcd346f7a996aec5d
2021-10-27 15:44:38 -04:00
William Wilgus 1cec2c7a73 root_menu fix red for devices with RTC_ALARM but no tuner or recording
Change-Id: I36b21c3d1ef4a4ce3b275a0ee793fbf9538b69ae
2021-10-24 00:12:06 -04:00
William Wilgus 3e10ecb82a root_menu.c code clean up -- stir the ifdef mess?
Change-Id: Ia0a847b5552766e5c78dd2ab00d019e631d600aa
2021-10-23 23:30:42 -04:00
William Wilgus 36d319b084 Open Plugins Ignore hash for lang Ids
no need to look up a hash when we have another searchable field
remove some un-needed checks

Change-Id: I394e5f796a164aa4bcb68a56ca02cd6a7f18d332
2021-10-23 02:45:54 -04:00
William Wilgus 789b2e089e plugin.h change plugin_open() path and parameter to const
it doesn't modify the args..

Change-Id: Ie8e1e36a060231c0137292c770e4f77da3b8203a
2021-10-22 23:17:33 -04:00
William Wilgus f4c7dc933d lua add ability to pass PLUGIN_ ret vals with os.exit() + add defines
Change-Id: I45998245271fbd8fee4534f8497b014025e4dcc7
2021-10-21 22:28:05 -04:00
Christian Soffke 1697b13693 whitespace fixes
Change-Id: I86880595b78e3cae62361c32ca57cf6f6a4ad963
2021-10-21 22:42:01 +02:00
William Wilgus cf96a4d386 file tree filetype_list_viewers exit from list before execution
no need to do a callback just to exit the list right after
executing a viewer plugin

Change-Id: I4598ab189bd7d1f350156af75480cbe7103e9e4c
2021-10-21 03:16:54 -04:00
William Wilgus af573708ed extend filetype_get_plugin() search for viewer by fileext
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
2021-10-21 01:45:47 -04:00
William Wilgus 9878226e4d filetree.c move static and stack allocated buffers around
it makes more sense to make the main buffer static and make the
second (infrequently needed) buffer as stack allocated

Change-Id: Ide7c1a7a312124e47a23ed0ab75a90d7b8be982e
2021-10-20 16:05:21 -04:00
William Wilgus e1553d860d Open_Plugin add checksum on struct offsets
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
2021-10-18 23:30:27 -04:00
Aidan MacDonald 0f68866ae5 fiiom3k: bump power on delay to 200ms
Needed due to a report that 80ms was not working.

Change-Id: I5f0f750b0530f5b84ffba58c5d7ff8b283095c4b
2021-10-18 23:03:04 +01:00
Aidan MacDonald 957add9d75 fiiom3k: adjust power on delay to 80ms
OST timer fix (7a5130a277) causes a boot failure on some units,
the battery voltage reading needs more time to stabilize.

Change-Id: Ic4a9ba90a16fab8ac6d27dbbe7af381f7c810f8f
2021-10-18 21:45:03 +01:00
Dana Conrad 6253cdebed ErosQNative: Fix mdelay calls due to g3859
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
2021-10-16 16:58:19 -04:00
Aidan MacDonald 7a5130a277 x1000: fix broken OST2 timer prescaler
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
2021-10-16 16:58:19 -04:00
Christian Soffke bf54002bc1 Fiio M3k UI Simulator: Fix upside-down mapping for volume buttons
Change-Id: I57a1ee1ac43ea0eb5587e6249ef6bb06ab7342af
2021-10-16 16:49:56 -04:00
Aidan MacDonald d085d01f5e x1000: enable DMA for USB driver
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
2021-10-16 21:14:42 +01:00
Aidan MacDonald 4fc37eb47f usb-designware: port to new USB API
List of all platforms using this driver:

- Sansa Clip+ (tested, works)
- Sansa Clip v2 (untested)
- Sansa Clip Zip (tested, works)
- Sansa Fuze v2 (untested)
- iPod 6G (untested)
- iPod Nano 2G (untested)
- FiiO M3K (tested, works)
- Shanling Q1 (tested, works)
- Eros Q (tested, works)

Change-Id: I403ec64b030ea38f22cb52b31865639a78cd11e4
2021-10-16 21:14:42 +01:00
Aidan MacDonald 24294bda15 usb: ensure RX buffers are a multiple of the packet size
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
2021-10-16 21:14:42 +01:00
Aidan MacDonald a665c1faad usb: remove dead code in usb_storage driver
Change-Id: Id6fc3520dad1adace33fd1014288ccb4cf5818af
2021-10-16 21:14:42 +01:00
Aidan MacDonald 988f244c74 usb: port usb_storage control request handling to new API
Change-Id: I1a19e09fdc0f05473d53c39bab0761d5cb8f6ff0
2021-10-16 21:14:42 +01:00
Aidan MacDonald 1b2cc053d3 usb: port usb_hid control request handling to new API
Change-Id: I9028cf06e91c9fcbe271f6ad81d6b252cb4e7cec
2021-10-16 21:14:42 +01:00
Aidan MacDonald 3318ba4795 usb: port usb_serial control requests handling to new API
Change-Id: I1405c9279e0e8e490e2bb2d03ff192b36db2634b
2021-10-16 21:14:42 +01:00
Aidan MacDonald 77731c3579 usb: port usb_core control request handling to new API
Change-Id: I3850c9cfcb87831e56884c83e31f728590b76f83
2021-10-16 21:14:42 +01:00
Aidan MacDonald 82efb1150e usb: implement new API with legacy emulation layer
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
2021-10-16 21:14:42 +01:00
Aidan MacDonald dff8320a5d usb: add request data argument to all control request handlers
Change-Id: I237143fa0d95c914b8e25ed22f8acde96ec00551
2021-10-16 21:14:42 +01:00
Aidan MacDonald b69d43c247 usb: give USB transfer completion events two data pointers
Change-Id: I036cc7f02c2f86a364d2dba59493a6aa893f2c16
2021-10-16 21:14:42 +01:00
Aidan MacDonald ec164c389c usb: introduce new control request API
Change-Id: I6545d8985ab683c026f28f6a7c0e23b40d0a6506
2021-10-16 15:58:43 -04:00