There are numerous sub-commands, this makes it possible to call the others.
Also in this patch is the ability for the "default" ATA driver to
query smart data too
Change-Id: Ie3aaf9e0b2d7a5d25d09dea34e4f10ee29047e1b
This is an unofficial command that many USB<->ATA chipsets support,
allowing direct passthrough of ATA commands to the device.
We don't pass things through as-is; instead we only intercept and handle
requests for IDENFITY INFO and SMART. Everything else will return an
error.
Change-Id: I3bbb76990e5f6f0512f6eb42825fa505475b2ecd
(From 4MB->2MB and 8MB->2MB, respectively)
This is a hosted platform with a decent amount of free RAM; however
plugins and codecs are dlopen() which doesn't count against those
buffers. Furthermore, the rgnano uses musl libc which does NOT
implement dlclose() so plugins, codecs, etc stick around in RAM
indefinitely even if they are never used again.
By shrinking these buffers we free up a bit more headroom for dlopen()
to leak, and for the host OS to provide disk caches and whatnot.
Change-Id: Ie657bd3b9fc8bd2a1f4bbc07debe3b10538c41c3
Shrink audio buffer from ~256MB to ~192MB. Increase plugin buffer size
to 2MB, not that it should matter given how much extra RAM this platform has.
This leaves plenty of room for the base OS to do what it needs to do.
Change-Id: I59ca235b9cf80cf86d406e4a144fee7d7784ed5d
Hosted platforms use dlopen() for plugin loading, and hibylinux is
relatively RAM constrained, so shrink this will free up more memory to
the OS for plugins to use.
Change-Id: I6b7cb17b964eaf5afc4958db242dfe4b82178e2e
This represents a 256K increase from the former (MEMORYSIZE-0.75), and
is necessary due to the growth in our binary sizes over the past decade
or so.
It is debatable if this is enough given that our actual memory
usage is approximately (MEMORYSIZE+3) megabytes (plus runtime OS
overhead) for the typical hosted build, but giving the host OS a bit
more breathing room is warranted.
Change-Id: I53e044585a32efd50a85e68d64fd21921eda01a3
We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.
This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match. This includes:
* utf8decode() and friends
* font manipulation, caching, rendering, and generation
* on-screen keyboard
* FAT filesystem (parsing and generating utf16 LFNs)
* WIN32 simulator platform code
Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.
Appears to work on:
* hosted linux, native, linux simulator in both 16/32-bit modes.
Needs testing on:
* windows and macos simulator (16bit+32bit)
Change-Id: Iba111b27d2433019b6bff937cf1ebd2c4353a0e8
By switching them from (const void* volatile*) to (void* volatile*)
The 'const' bit was causing GCC>4 to optimize away writes to those
addresses when compiled with -Os, badly breaking the interrupt handler.
Change-Id: Ia4b0ca37e082bddf78e084b80a5e550894645f1a
* move all state into IRAM
* eliminate dummy variables
* get rid of 'naked' attribute and (slightly wasteful) hand-written asm
in favor of auto-created 'interrupt' code
Change-Id: Ie6a2e12a4c1a0faa6ae89504cf931657044bd457
It is particularly stack-heavy (>1.25K, >2.25K with 32-bit unicode)
Its only caller was font_load_ex() but that can be called recursively
which _really_ blew up the stack.
Change-Id: I211cd33ca3478b2bd01d3ddcf6c890399af2fb9c
By default STMP3700 launches from negative edge for capture on positive edge.
If we leave DPL (bit 13 of reg 0x13) to 0, it will be captured on falling edge,
resulting in a potentially undefined behavior. Some make sure LCD captures on
rising edge. Alternatively we could change the dotclk polarity in VDCTRL0.
Change-Id: I4ceb2f5a9be88e07f0af9bf493b7881883320fda
We've received multiple reports from users of 6th gen iPods where we
fail to find any mountable partition. A user was able to supply an MBR
dump, which showed that the "type" listed for parition 0 was set to 0x00
(ie "unused"), leading us to (correctly) completely ignore that entry.
However, it looks like the stock firmware ignores the type and
unconditionally uses the first entry even if it's nominally "invalid"
So, to deal with this, always try to mount partition 0 if it is not one
of the two "extended partition table" types. If that speculative mount
succeeds, we now treat it as type 0x0c (Fat32 w/LBA) internally.
Note that this will not allow the partition to be mountable over USB, as
the MBR is still incorrect, leading the host OS to ignore the partition.
Further complicating things, the stock Apple firmware always constructs
a fake MBR to hand to the host!
To prevent user confusion with these devices, we may consider faking the
MBR too; alternatively we could correct the MBR and write it back to
disk, perhaps via a debug menu option.
Change-Id: I1e9392d20401eb94ecc6d70263fb0e45392a9bd4
Battery time estimation works now.
This commit also changes the mksquashfs path to FUNKEY_SDK_PATH.
Change-Id: Ic0aa4c40011b0716f1c36c014377eaccb486e841
We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.
This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match. This includes:
* utf8decode() and friends
* on-screen keyboard
* font manipulation, caching, rendering, and generation
* VFAT code parses and generates utf16 dirents
* WIN32 simulator reads and writes utf16 filenames
Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.
Known bugs:
* Native players in 32-bit unicode mode generate mangled filename
entries if they include UTF16 surrogate codepoints. Root cause
is unclear, and may reside in core dircache code.
Needs testing on:
* windows simulator (16bit+32bit)
Change-Id: I193a00fe2a11a4181ddc82df2d71be52bf00b6e6
iap_reset_state() and iap_getc() are now passed the logical IAP port
(0 is dock/only connector, 1 is headphone connector)
Change-Id: I97421146a8cab032b90c9b4eb55b50aa00d73312
According to screen driver this device screen is actually 16 bit RGB565 (https://github.com/DrUm78/linux/blob/FunKey_S/drivers/staging/fbtft/fb_st7789v.c#L137).
This also fixes the color banding issues we had before and boomshine doesn't segfault anymore. Also building rockpaint now that's possible.
Change-Id: Icee49c347fbfabc79e0040314ec148cb77ca6325
Actually power off the handheld with the sleep timer and idle poweroff functions instead of closing rockbox.
This commit also moves setting system volume to max from the launch script to system-sdl.c so it works when running rockbox via instant play.
Change-Id: I174b67c6abef451faa05f4a8f52b8d9eeed98a22
...Except for simulators, those always need the cursor
In practice this only affects the RG Nano as it is currently our
only SDL target that lacks a touchscreen.
Change-Id: I292f923848528c233da518b062d9ccd8a03515dd
Instant play is a Funkey OS feature that allows it to relaunch at boot the last program it was running before shutting down, which means that if the handheld is powered off (holding the power button) while rockbox is running the next time it's powered on rockbox will launch at boot.
This commit also handles system brightness/volume in rockbox itself instead of the launch script, so the values are properly reset when powering off the handheld while rockbox is running.
Change-Id: Ie1adbf71069aeed5fbf6670971718a2f718716a3
* Move to a structure instead of pointers to registers
* Autobaud operates per-uart
* When explitily setting uart speed, it applies to all uarts
This allows both UARTs to be enabled and serviced simultaneously,
allowing either accessory port to be used. Note that the last
port to receive something is where subsequent transmits are directed,
and only one set of IAP state is maintained.
To change this, we will need to revamp IAP to support more than
one state machine, and then extend the serial API to allow for both
UARTs to be used independently. Probably not worth the effort.
Change-Id: I0142f0906706fc0c4ee6d6d7aa6b0515e1a749dd
This caused the devices to crash a few seconds after sending the command. A small power consumption increase is possible when the screen is off with this patch, but Rockbox doesn't crash anymore. Type 0 and 1 are not affected as they use a completely different sequence.
Tested on iPod 6G LCD type 1 and LCD type 2. Type 0 is similar to Type 1, Type 3 is similar to Type 2, so it should cover all available LCD types.
Change-Id: I3e8a653ca22bf59e3db38e1d26e747b358e62cb2
A bit of context, this device is a clone of the FunKey-S with a different form factor, hardware is mostly identical, the relevant difference is it has audio out (via usb-c, adapter to 3.5mm is included), this is the reason why the FunKey-SDK is needed for bulding.
This port is based on the old SDL 1.2 code because the device doesn't have SDL2 support. Alongside what was supported in the SDL 1.2 builds this port supports battery level, charging status and backlight control.
Change-Id: I7fcb85be62748644b667c0efebabf59d6e9c5ade
This should allow either accesspory port to be used for IAP comms.
No regressions on an ipodphoto and mini2g through the dock connector,
but I don't have any headset-attached accessories to test against.
Change-Id: If217d8147ee871b20ad5f81ba95542379eb9f2dc
This lets us have multiple serial ports enabled, which will help with
4th-gen ipods that have a serial port in the HP jack as well in the dock.
Change-Id: I6a00a776020848a6908413e05a6f27bad65b2d8e
Instead of using the generic hosted sysfs code, which expects
a full path, the ibasso code's sysfs code uses an enumeration.
Unfortunatley the generic power input/charging code used the former
API but linked with the latter. oops.
Correct this by placing a private copy of these functions in
the ibasso-specific port, and removing the generic version from
that build.
(A "proper" fix would be to rework all 17 of the ibasso sysfs calls
to use the generic sysfs API)
Change-Id: Ic13adc9782d85560f0c74d77f60a629619d38668
Moves special folders (like .rockbox) on top and makes filenames sorting look more consistent with folders sorting. See https://forums.rockbox.org/index.php/topic,55303
Change-Id: I6ffd9b3ea0acfcbab69f09415f4e9f53737e7769