Commit Graph

35461 Commits

Author SHA1 Message Date
Aidan MacDonald 09fc9ee9a3 sim: change Eros Q native bitmap to a symlink
Change-Id: Id55ef276af0de52d7cbd8c7cdc6da46f171a01bd
2021-07-18 14:15:25 +01:00
Aidan MacDonald 07a3f6bcdb add Eros Q native simulator build
Change-Id: Ifdc882d19020da2e18234d6276409ad3e7efa138
2021-07-18 13:51:30 +01:00
Dana Conrad 3e7a09cb0d New Port: Eros Q Native
What works:
- LCD: 16-bit RGB565
- all buttons, including scrollwheel
- SD Card
- Battery level and charging/not charging status
- USB
- audio
- sample rate switching
- HP / LO detect, with "safe" fixed LO volume -
   LO volume will only be put to user-defined max volume
   if headphones are not present.
- rtc
- Plugins build, tried a couple and they seem OK
- Bootloader, installable to nand via usbboot

What doesn't work:
- Dual Boot
- power on/off has intermittent, low volume audio click
   (sometimes it's completely silent, sometimes there's
    a click)
- Audio uses 16-bit volume scaling, so clicking/popping
   is pretty bad at lower volumes - need 32 bit volume
   scaling, 24 bit I2S data
- USB HID keys not yet defined
- no jztool support

Unknowns:
- Stereo Switch pins: Direction select, AC_DC
   (probably not even hooked up)
- What is the actual purpose of the Stereo Swtich?
- How does the bluetooth module connect?

"Someday" stuff:
- get LCD working at higher bit depth
- Bluetooth

Change-Id: I70dda8fc092c6e3f4352f2245e4164193f803c33
2021-07-18 12:14:35 +00:00
James Buren 64a24591ae crc32: add fast variant of regular crc_32r function
This relies on a macro, CRC32R_FAST, to select which version to
compile with. In tests the fast version is 2x faster at the expense
of requiring 960 more bytes for the lookup table. For now the default
is the space optimized version but in the future I would like to enable
this for ports where we can afford the extra storage and/or memory
requirements.

Change-Id: I25397dadedc3187bb02b2444f8b8ded77c2509b6
2021-07-18 05:17:31 +00:00
Solomon Peachy cd17decd5a xduoox3ii: Add "Super Slow" filter roll-off
I'm not happy with the proliferation of filter-roll-off options
but I don't have a less ugly solution.

Change-Id: I740fca006fa0c3443a467acfea55b6574d48346b
2021-07-17 08:18:31 -04:00
Solomon Peachy ec31a2b4ad Fix builds.pm syntax error (1d72d9cf)
Change-Id: I7c7e8e7de16157ecc6535a8b461c12430bd376fb
2021-07-15 15:40:26 -04:00
Aidan MacDonald 1d72d9cf28 builds: add Shanling Q1 to unstable
Change-Id: Ic490b4d68c2faa35dd8cb6733766019aeeb192e7
2021-07-15 18:54:35 +00:00
Solomon Peachy 144d1b1e81 misc: Fix up a few warnings uncovered by LTO
* direct use of memcpy() instead of ci->memcpy() in flac and mod
 * uninitialized variable in mpegplayer

Change-Id: I2d08682d5f66c319780e69e3ff63d600c61d8f5a
2021-07-15 18:37:42 +00:00
Aidan MacDonald 4c60bc9e68 New port: Shanling Q1 native
- Audio playback works
- Touchscreen and buttons work
- Bootloader works and is capable of dual boot
- Plugins are working
- Cabbiev2 theme has been ported
- Stable for general usage

Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps.

There's a few minor known issues:

- Bootloader must be installed manually using 'usbboot' as there is
  no support in jztool yet.

- Keymaps may be lacking, need further testing and feedback.

- Some plugins may not be fully adapted to the screen size and could
  benefit from further tweaking.

- LCD shows abnormal effects under some circumstances: for example,
  after viewing a mostly black screen an afterimage appears briefly
  when going back to a brightly-lit screen. Sudden power-off without
  proper shutdown of the backlight causes a "dissolving" effect.

- CW2015 battery reporting driver is buggy, and disabled for now.
  Battery reporting is currently voltage-based using the AXP192.

Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a
2021-07-13 22:01:33 +01:00
Aidan MacDonald 3abb7c5dd5 x1000: revamp MSC driver card detection logic
Debounce logic now handles both removal and insertion and verifies
the detection is stable for 100ms before taking any action.

This solves the bootloader "file not found" issue on the Shanling Q1.
It seems a false removal event was generated, causing the filesystem
to be automatically unmounted. Probably this is due to some transient
noise at boot. Delays didn't solve the problem, probably because the
bogus hotplug event was queued, and normal mdelay() would simply delay
event delivery.

Change-Id: I8b03fb3550309f5a7ab4be0be7465a3dab2d3450
2021-07-13 22:01:17 +01:00
James Buren 3c4fdf10e2 crc32: add fast variant of regular crc_32 function
This relies on a macro, CRC32_FAST, to select which version to compile
with. In tests the fast version is 2x faster at the expense of requiring
960 more bytes for the lookup table. For now the default is the speed
optimized version but in the future I would like to enable this for ports
where we can afford the extra storage and/or memory requirements.

Change-Id: I8c7fde6b6ff130f0fdc7c8e472825e25bcdba022
2021-07-13 04:41:32 +00:00
Tomasz Moń 321680973b
Sansa Connect: Display battery info in debug menu
Show battery temperature, current, discharge power and available energy
in battery debug menu.

Change-Id: I799af4e5ca7ec168d726e689264e0f092ebc2bf7
2021-07-12 14:14:59 +02:00
Aidan MacDonald 84362141a0 x1000: Unified flash bootloader installer
Change-Id: Ib1d41d4e7d663ff8a21eb08108c13568f7408533
2021-07-11 15:39:50 +01:00
Aidan MacDonald e9d228832c x1000: Unified bootloader
Change-Id: Ib1f2ca2a376866c61dd1bd62abd6e31210d11e5c
2021-07-11 15:39:40 +01:00
James Buren d6dcb99684 uisimulator: implement sim_modtime
Change-Id: I1094632df092ba63605631333e939cf30b585a59
2021-07-11 13:48:26 +00:00
James Buren 1298e47134 zip: include strlcpy.h
Change-Id: Ic26a95e35a005837cbd3c8d9318d2cced9b726ff
2021-07-11 13:17:54 +00:00
James Buren fa743258ea filesystem: implement os_modtime for unix
Change-Id: If030d526f29aa786b5a37402413d804752286cf5
2021-07-11 12:40:08 +00:00
James Buren 8846e087c0 zip: implement zip extraction support
This adds code sufficient to extract files to available storage given a
suitable root directory to extract to. It works on an already open zip
handle and also supports chain-loading a secondary callback in the event
that integration into the process is desired.

Change-Id: Id200d8f20d84a0cbd22906470de8bbd21d4525ef
2021-07-11 05:14:20 +00:00
James Buren a1bcca645b zip: rename modts field to mtime
This brings it more in line with other structs with this exact same data
type and usage.

Change-Id: I5fe8564750ef28ccd0b12efedca2e6958369f712
2021-07-10 13:44:03 +00:00
Tomasz Moń 6c084ac3ea
Sansa Connect: Ensure LCD starts before backlight
Extra delay prevents white flash after hold switch release.

Change-Id: Ib0d33937dcbb738b913388e7df92ffdf9346c9f9
2021-07-10 13:20:29 +02:00
Tomasz Moń b4ecd612f7
Sansa Connect: Use deviceid in USB Serial Number
Atmel AT88SC6416C CryptoMemory is almost I2C compatible. The device
is connected to bitbanged I2C bus shared with compliant I2C devices.

Change-Id: Iec54702db1bdfb93c01291eef18ec60391c63b16
2021-07-10 08:56:32 +02:00
Solomon Peachy 663539619c configure: fix a typo that could break voice builds
(If you don't have espeak, festival, or flite installed)

Change-Id: I5820535c55cc02e32bf31f3e30070b2c1e68ff87
2021-07-09 15:10:50 +00:00
Tomasz Moń 8de163b8ae
Sansa Connect: Fix reported CPU frequency
Make frequency related comments accurate. Disable UART0 clock.

Change-Id: I224a3d6656ad53165dcff68ed716fa2c6863240d
2021-07-09 14:16:05 +02:00
Tomasz Moń 60e2cd6de9 DM320: Regorganize LCD and TTB memory layout
Do not introduce any change for M:Robe 500 as it uses the two LCD frames
in non-obvious way.

Sansa Connect and Creative ZVM use only single front framebuffer.
Place TTB at DRAM end to minimize memory loss due to alignment.
Reserve as little as possible memory for the LCD frames.
On Sansa Connect this change extends audio buffer by 858 KiB.

Change-Id: I21bdeec4cfba86d71803a39acd651a87e73767e6
2021-07-09 09:24:38 +00:00
Solomon Peachy 2e9b93dc5d build: Nuke the ASMFLAGS workaround for gcc 3.4.x
Change-Id: I0f21e9539d39afd54916fa8d84ce798eef474a2c
2021-07-08 20:47:30 -04:00
Solomon Peachy 2c984f3714 build: use gcc-ar / gcc-ranlib in preparation for link-time-optimization
Change-Id: If5fd9a8f15200fca9a89999605394f7527387a2b
2021-07-08 19:53:05 -04:00
Solomon Peachy 2ff3425ab1 build: Rename SHARED_LDFLAG to SHARED_LDFLAGS
Change-Id: Icb81c72fbcfcdad624112a386ba38a40a830d18f
2021-07-08 19:53:05 -04:00
James Buren a9f36efa62 file/fat: rework utime function as modtime extension
This eliminates the dependence on a special struct since we were only
using the modtime anyway. But it no longer fits any known standard APIs
so I have converted it to our own extension instead. This can still be
adapted to existing hosted APIs if the need arises.

Change-Id: Ic8800698ddfd3a1a48b7cf921c0d0f865302d034
2021-07-08 17:47:51 +00:00
Solomon Peachy a0f1236e88 Fix yellow in android builds.
Change-Id: Ic22908e249f2db85c029e1644c9531a12ed87993
2021-07-08 13:06:41 -04:00
Solomon Peachy 17f7dfb9d2 build: Make checkwps use global GCCOPTS
Change-Id: I6859d3611b2008bf8a6ec52887d8e278df1ebd9f
2021-07-08 12:06:57 -04:00
Aidan MacDonald 0e1a90ea1d x1000: SPL refactoring
This streamlines the boot code a bit and reduces target specific
boilerplate. The clock init hack used by the bootloader has been
"standardized" and works for the main Rockbox binary now, so you
can boot rockbox.bin over USB without special hacks.

Change-Id: I7c1fac37df5a45873583ce6818eaedb9f71a782b
2021-07-08 16:01:38 +00:00
Aidan MacDonald 65aa9ce570 x1000: more CPM register definitions
Change-Id: Ie6fa343a65a6bd19e578664b10bac771289ed0b3
2021-07-08 16:01:38 +00:00
Solomon Peachy a952cf52d5 voice: Corrections to 24-hour time voicing:
* Voice leading "Oh" if hours is under 10.

 (ie "0900" is read as "oh nine hundred hours"

Change-Id: I09853909221e0dd6da354f7e4bb9733ff5edca90
2021-07-08 10:57:57 -04:00
Solomon Peachy 39b82afb45 Fix warnings introduced in c174d3a5 (redux)
Change-Id: Icc871bd9875aa0d092a4fba3e8a6c3a598053854
2021-07-08 14:16:25 +00:00
Solomon Peachy 78eb87f453 Revert "Hosted & tool builds need utime.h"
This reverts commit a8fd590003.

Reason for revert: Inverted polarity and it didn't work anyway.

Change-Id: Ife548ce4608405e3243c84a1d72090603fd2decc
2021-07-08 14:07:58 +00:00
Solomon Peachy a8fd590003 Hosted & tool builds need utime.h
Should fix the warnings introduced in c174d3a5

Change-Id: Ib4bd863caef4dedf28dadab8b58b9a165ed4ef9b
2021-07-08 13:55:12 +00:00
James Buren c174d3a544 file/fat: add utime function
This emulates the traditional utime function from UNIX clones to allow
for manual updates of the modification timestamp on files and directories.

This should only prove useful for non-native targets as those usually
have a libc version of utime.

Change-Id: Iea8a1d328e78b92c400d3354ee80689c7cf53af8
2021-07-08 13:15:30 +00:00
Solomon Peachy e6ee3dd17c builds: Move the Sansa Connect to unstable
Change-Id: I0087cb3e7d1b412353d3a02d7dd282a27c5a69fc
2021-07-08 12:25:36 +00:00
James Buren 49ca4b3e5e timefuncs: add dostime_localtime function
This does the opposite of dostime_mktime, converting time_t back to
the two dos date time values. We use gmtime_r for native because that
is what is available and acts the same as localtime_r on other platforms
with a regular libc available.

Change-Id: If79469d0aae2d7c5dcdd905fbf04963669aa1138
2021-07-07 17:31:00 +00:00
Tomasz Moń bce6771730
Sansa Connect: Reduce USB RX buffers from 129 to 2
Reducing number of fake RX buffers saves a bit more than 127 KiB RAM.
Fix compilation with CPPI logging enabled.

Change-Id: If1ad3a6fc251e284caaac78c2406a58f3d6547bb
2021-07-07 18:48:24 +02:00
Solomon Peachy 7f638e54ee RFC: Fix a couple more dangling stack-allocated viewports
They could end up getting referenced after the stack has been popped.

Change-Id: I12abbf3f436ecfde76a37f2623a044915800d2b2
2021-07-07 15:19:43 +00:00
Tomasz Moń 99bf506407 Sansa Connect: Prevent unresponsive interface
AVR interrupt signal can remain active if the state has changed during
state read. In such case, there won't be intterupt and the interface
would appear unresponsive until AVR thread received event (e.g. USB
connection/disconnect). Solve the issue by not waiting for event if AVR
interrupt signal is active prior to event wait.

Change-Id: I86e388c7cd6da76e3abe7bf7114940f331e4c308
2021-07-07 14:51:15 +00:00
Solomon Peachy e9ae1e9a8b Fix red introduced in 841e704fc3
Change-Id: I5a924f77231a4764f3ad9b196875f5bf073945d6
2021-07-07 13:49:24 +00:00
Tomasz Moń 841e704fc3
Sansa Connect: Read HDQ battery data
Make it possible for target to provide voltage, percentage and time to
empty values. The voltage measurement is nice to have in debug menu even
if the actions are taken only based on percentage. Perform battery level
estimation based on voltage only if percentage is not available.

Use time to empty based on actual power consumption. This makes the
estimated runtime displayed in Rockbox Info to react to backlight
setting. The bq27000 updates time to empty estimate every 5.12 seconds
so it is possible to see the estimate with backlight off on the screen
if user enters Rockbox Info, activates hold switch, waits 11 seconds and
releases the hold switch.

Change-Id: Iafe3fa0fb334e3428e3a0ad05b2c020d208dc934
2021-07-07 08:24:01 +02:00
James Buren b87e75f768 zip: import initial module
This provides rudimentary support for parsing the contents of a ZIP
file. For now this just supports uncompressed file entries but DEFLATE
support is planned. This also only implements a low level public API
so more work will be needed to make it usable by application code.

Change-Id: Ia68b3078e5276666a0e5023f4bc7a9f94272738a
2021-07-05 19:30:05 +00:00
Tomasz Moń 2acf8db3e1
Sansa Connect: Power off LCD to save power
Prevent startup screen flash by properly using AVR LCM functions. Power
off LCD when not needed to improve battery runtime.

Change-Id: I76e3c5c0208774f189fbc6f7d7b3c9e22c062285
2021-07-05 15:19:52 +02:00
Tomasz Moń 89d3ca77b6
Sansa Connect: Fix power off panic screen
Queue power off requests because power_off() can be called within tick
context that must not acquire mutex.

Change-Id: I6f1a8f81d15518876cd03556118fc9eb37b8175f
2021-07-04 13:08:42 +02:00
Tomasz Moń e11fa5f74e Sansa Connect: Initial libertas WiFi driver port
Import non-free firmware image from linux-firmware package.

Firmware loading works but is disabled at compile time because just
loading firmware without configuring device results in higher power
consumption without any benefit to end user.

Change-Id: I8fd252c49385ede1ea4e0f9b1e29adeb331ab8ae
2021-07-04 07:41:44 +00:00
James Buren c9f2308a1d fat: move fattime_mktime to timefuncs
This moves the time conversion function to timefuncs since it has
uses on ports that don't use the FAT driver. This function has no
dependency on the FAT driver as it is so this should not cause any
issues. To reflect this separation the function was renamed to
dostime_mktime since it is really for DOS timestamps. The places
where it was used have also been updated.

Change-Id: Id98b1448d5c6fcda286846e1d2c736db682bfb52
2021-07-03 00:19:58 +00:00
Franklin Wei d1a92aafff sdl: increase default worker thread size.
This fixes a mysterious, long-standing crash that's been bothering me on
ipod6g for ages: a silent stack overflow in the sound mixing thread (which
is triggered upon loading a new sound, apparently) will thrash the memory
which is located directly before it in the address space.

In this case, it was the SDL_ButtonState variable which stores the mouse
button state that was being trashed. This was manifesting itself by making
the player always run forward, since MOUSE2 is mapped to +forward by
default.

Fix this by quadrupling the stack size of SDL-spawned threads (not the main
thread) from 1 KB to 4 KB.

Change-Id: I2d7901b7cee1e3ceb1ccdebb38d4ac5b7ea730e1
2021-06-28 02:51:48 +00:00