- Missing mutex unlock in nand_open()
- SET_FEATURE command incorrectly issued as a read operation
- Inverted protection bits, not sure how that happened...
- Block erase skipped ahead by a wrong amount, causing erases
spanning multiple blocks to erase the wrong blocks
This code was buggy as hell... it's in need of a major overhaul.
It's not very flexible or reliable, and access to the flash is
useful during development of a new port, even if not useful once
the port is complete.
Change-Id: Ib85ee7453beab9657e3d19798ebaa09174b3649e
The old code would seek forward by the frame length, expecting to see a
frame header there, perform a validity check, and then seek back to the
current header.
Unfortunately this doesn't handle situations where there is extra padding
between the frames, leading us to potentially read garbage, causing the
validity tests to fail and rejecting the file outright.
Instead, keep track of the previous valid header/position, and if we find
"valid" headers in a row return the first after seeking back to it.
This change allows the file referenced in FS13299 to be properly parsed, but
further work is needed to get the file to be playable. (file reports itself
as layer 1, variable bit rate, variable sample rate!)
Change-Id: I85f61a6360cc041a172db4b7a6b5516e5b60ceee
Intercept buttonpress and action, and nullify both if the button
is part of the touchpad. Only affects autolock functionality.
Adding removal of note about autolock in the manual - the lock
button no longer needs to be pressed at least once to prime
the autolock, if enabled, since commit 14f7a95
Change-Id: Ic3582764df490d96abc2d78116f23cbe0fdd6173
On devices that can assign interrupt IN, bulk IN and bulk OUT endpoints
this change results in the serial interface working out of the box on
Linux and Windows. On Linux it is registered as ttyACM device and on
Windows it is assigned a COM port number.
On devices that cannot assign the interrupt IN this change won't have
any effect.
Implement minimum required interface control requests. Respond with
whatever line coding was set to make terminal programs happy.
Change-Id: Id7d3899d8546e45d7cb4ecc3fe464908cb59e810
Disabling double buffering results in expected CPPI TX behaviour. With
the double buffering enabled, sending single ZLP resulted in two ZLPs
being available. The two ZLPs is problematic because this causes Windows
to reset USB device after failed SCSI command.
The problematic sequence on Windows 10 was as follows:
* Host sends SCSI Mode Sense(6) Informational Exceptions Control(0x1C)
* Device sends ZLP
* Device sends command failed response
With endpoint double buffering enabled the ZLP was read twice by host.
As host was expecting command response on the second read (and got ZLP
instead), host attempts recovery by resetting USB device and retrying.
Change-Id: I64e95998f429ffb7b14143d956b1f29d20218d14
This imports the MD5 code used by other utilities and creates
a function for checking the provided NK.bin against known original
firmware checksums. Integration into mknkboot and beastpatcher is
also added.
For the sake of consistency with beastpatcher, mknkboot had its
printf statements rewrote to print to stderr like beastpatcher
does.
Change-Id: I0e52271d8d627a5b02302ab5cd1da2815b7cec1e
Allows for the i2c boilerplate to be shared between the M3K and
Shanling Q1 ports. M3K-specific quirks remain in button-fiiom3k.
Change-Id: I8879b603cefc16416bb200f1c484ca916d935c6a
Acknowledge SYS_USB_CONNECTED in all queues so USB task can gain
exclusive access to the storage.
Reduce CPPI requeue timeout to speed up disk access.
Change-Id: I322aae4cac679696bb8186ccacf838a18f0715e9
Correctly set endpoint maximum packet size so host will not consider
end of transfer after receiving first packet when transfer is larger
than 64 bytes (at High Speed the endpoint max packet size was set to
64 but according to descriptor it is 512).
Split DMA transfers up to CPPI_MAX_FRAG so we get single interrupt
after each call to tnetv_cppi_send().
Change-Id: I385b66bc5d71975a4e3e9167efac0b1334bd3ffc
Return complete R2 response to caller. Due to incorrect bitfield
handling only bits [127-96] were ever returned to caller.
Change-Id: I83726af35fb24a8051fcca8b8d019ad89d17500e
I had hoped this would fix FS#13297, but no luck. Might as well
do this change anyway, because it's the "right" thing to do.
Change-Id: I55819c881d2141dd565e1c1f21460578c9114ff6
I accidentally left this in commit 8056b7f, and I think I'm giving
up on this for now - it just gets too complicated in the usb use
case. Revert to BUTTON_PLAY.
Change-Id: I9e392a3d7f2c18f34de54ecbafdb27cdf863b28c
Avoids having to #define the names of GPIO pin interrupt handlers,
as they can now be set at runtime instead.
Change-Id: Ib5da1bdb475ff7b64280fe7cdd00adab63389152
The GPIO API was pretty clunky and pin settings were decentralized,
making it hard to see what was happening and making GPIO stuff look
like a mess, frankly.
Instead of passing clunky (port, pin) pairs everywhere, GPIOs are now
identified with a single int. The extra overhead should be minimal as
GPIO configuration is generally not on a performance-critical path.
Pin assignments are now mostly consolidated in gpio-target.h and put
in various tables so gpio_init() can assign most pins at boot time.
Most drivers no longer need to touch GPIOs and basic pin I/O stuff
can happen without config since pins are put into the right state.
IRQ pins still need to be configured manually before use.
Change-Id: Ic5326284b0b2a2f613e9e76a41cb50e24af3aa47
Port USB driver from Sansa Connect Linux kernel sources. The device
successfully enumerates and responds to SCSI commands but actual disk
access does not work. The SCSI response sent to host mentions that both
internal storage and microsd card are not present.
Change-Id: Ic6c07da12382c15c0b069f23a75f7df9765b7525
Modify count, buffer and start address only after successful transfer.
This makes the retry operation to use the same address and buffer as the
just failed transfer.
Change-Id: I4f49bbdc861d634e33ea5e939a9693474411d24d
But for stage1 (and non-hosted targets) we can stick with -std=gnu++03.
This keeps everyone happy with no apparent regerssions on older
host compilers.
Change-Id: I1300574557bc8d4d13e5cf07d4ae85645998f071
Add --with-sysroot= to the configure args of glib and dbus because
otherwise they get confused and try to use host system dependencies.
Also fix the broken restart logic so you can actually restart a build.
Change-Id: Ib456c04845d80cc923dcc6b83e57f67a0868104b
Basically it defaults to using C++17, which breaks the GCC compilation.
Instead, explicitly specify -std=c++03, which should work everywhere.
Change-Id: I821591dbbac4fab4b1d930702ed66c7c767b5c92
Add a check to see if the keys are currently locked and allow
them to be unlocked to ensure we don't get stuck when the current
playlist ends while the WPS is locked.
(Original by Aidan MacDonald)
Adding initialization for unlock_combo and to arm the autolock
(if enabled) without the user needing to press the lock button
at least once every boot (which is the prior behavior).
Removing screen_has_lock check from is_keys_locked()
Change-Id: I0fbf9b9746b011a7086ec8505a7ecc4b84f2d332
- Use unsigned bitfields in 'lcd_tgt_config'
- Set DTIMES when using an 8-bit bus width
- Allow using DMA big-endian mode
- Provide an #ifdef to avoid stopping DMA in the middle of a frame
- Correctly #ifdef LCD sleep code when target does not implement it
Change-Id: I327c6b05223638b876d5ab62cb6e48f82e6d5fa5
- Change busy loop to wait on the timer flag instead of hoping to
catch the timer at exactly the right moment... unsurprisingly,
that did not work well with higher frequency PWM outputs.
- Put GPIO data into a dedicated const array.
Change-Id: I2a920ed265c192da197a18c7242f3205d11636d3
The old name was a bit misleading. AXP173 is sort of the lowest common
denominator of a series of related chips. The M3K uses an AXP192 which
has a few extra features vs. the AXP173.
New voltage regulator stuff was added for the sake of the Shanling Q1
native port (that player also uses an AXP192).
Change-Id: Id0c162c23094bb03d13fae2d6c332e3047968d6e
- Drop obsolete NAND patch script (it's simpler to use 'dd' directly)
- Remove an outdated comment
- Fix missing 'void' in a function definition
- Reset the poweroff timer when we poke the backlight
Change-Id: I752624386f30ac95f41a731d2b6be837e12275a9
Some audiohw API calls are shared between playback and recording,
eg. frequency settings. Implementing these in the DAC driver won't
work for the M3K, as it uses a separate codec for microphone input.
Change-Id: Ieb0a267f8a81b9e2bbf0bbca951c5778f8dcd203
I think this covers everything now, although some fields are missing
enum values. Those can be added in if and when they are needed.
Change-Id: Ib1a94ba9c9a5949b6a038f8c1a49786823fae58f
Allows the ACTION_YESNO_ACCEPT action to be set
to a button release by ignoring certain system events.
Moving USB init in main.c to the last thing to prevent
getting stuck in the USB prompt, if enabled.
Also changing ACTION_YESNO_ACCEPT to button release on erosq
Change-Id: I5e7498521a13cb4e840223dd0b9c8633e99093bc
All this tested on erosq, I'm not sure if this will break on other targets or if there is a reason this shouldn't be done.
apps/menu.c:
Added CONTEXT_MAINMENU|ALLOW_SOFTLOCK in do_menu(), this allows the user to lock the keys in most places within the main menu tree.
apps/tree.c:
Added CONTEXT_TREE|ALLOW_SOFTLOCK in dirbrowse(), this allows locking the keys in most other contexts not covered by the above.
Notable exceptions I've found that still cannot be locked: View Playlist, any settings change screen (ex. Shuffle No/Yes, Volume Select dB)
Adding fix for Advanced Key Lock feature brought to light by this change in apps/action.c.
Expected behavior for Advanced keylock is now (according to my testing here):
Volume: Can be exempted from keylock anywhere
Skip/Scrollwheel: Can only be exempted in WPS
Seek: Can only be exempted in WPS
Play: Can only be exempted in WPS
Backlight exemption is same except the Volume exemption doesn't work outside the WPS, but I don't believe that is due to this change.
Change-Id: Ifa3d1a03cf4884520a37dd91ed53a825cdb66778
- Add support for skip and seek while the player is locked.
(Thanks to @bahus for the suggestion)
- Fix touch zones because the down button zone ended up being
a lot smaller than expected due to the touchpad's wonkiness.
Also added a visual display of the touchpad to its debug menu.
- Fixes the pictureflow keymap because it was mostly unusable.
Change-Id: Ic0da4f8df3613ff7828ce1cb940ed9e77ada3281
To enable support targets must define HAVE_LOCKED_ACTIONS and then
handle the CONTEXT_LOCKED flag from get_context_mapping().
Change-Id: I92703b534e4a45b4ebbf9bf98af42df9b8ac3b1a
Clearing recoverzap parameter exists the Recovery Mode. This makes it
possible to run Rockbox on Sansa Connect without relying on original
Linux firmware.
Enable write-through cache on flash memory as write-back complicates
handling without any real benefits. The flash memory accepts commands
as series of writes at predefined addresses, so it is important that
the cache does not interfere with the writes.
Change-Id: I219f962f20953d84df43012cf16bbb16d673add8
rather than dumping all the settings allow a filter function
to choose desired settings
in menucoresettings you can see an how to do exact text matches
or wilcard matches you can even use luas version of regex
Change-Id: I4c7f7592498ea194e06e9a556b77ffd57f5d4223
return the nextfunction and nil instead of pairs it allows a faster
return to lua rather than calling the lua function
pcall(fnpairs) from c and returning the result back
into lua to kick off the search
yeah, no clue why I didn't realize that before..
testing in x86 and ARM..
its more RAM efficient to do the initial creation
of the stack in lua code for the __pairs functon
its not faster but being that its a one time hit per
iter creation the reduced churn alone should be worth it
along with a reduced peak RAM usage
fix bug where a failed module can not be reloaded
optimize filetol
fix potential bug in splash scroller when no break character is found
Change-Id: I42c922e07039a19138b97c0d0e80cf3cf2426471