There's only a need to check every MAX_TINYNAME+1 bytes and that the
last character of the needed size 0xff in order to verify the size
of the block since the minimum indirectly-stored string is
MAX_TINYNAME+1.
Change-Id: Ic789376b8575bab9266fcd54c610db0961de5d7f
When dircache scanning is happening in the background, the user
can shut down the device before it is complete. Then, reset_cache()
sets size to 0 before it is copied to last_size at the end of
build_volumes(). When saved last_size is zero, scanning happens in
the foreground during next startup.
Avoid shrinking the size if the build is suspended.
Change-Id: Ife133e0be0dc0dfd53a4de119f70dba014c7ee68
cppcheck reported:
[chessbox/chessbox_pgn.c:51]: (portability) 'bufptr' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined.
Change-Id: Ib2139489fa316fb61b4bcdc08f17b97eb6ad0be7
Many includes of fat.h are pointless. Some includes are just for
SECTOR_SIZE. Add a file 'firmware/include/fs_defines.h' for that
and to define tuneable values that were scattered amongst various
headers.
Remove some local definitions of SECTOR_SIZE since they have to be
in agreement with the rest of the fs code anyway.
(We'll see what's in fact pointless in a moment ;)
Change-Id: I9ba183bf58bd87f5c45eba7bd675c7e2c1c18ed5
* 8 bits is enough to allow 260 character base names when five
bytes is the minimum indirect storage size (0..255->5..260).
* Don't truncate anything that's too long as that can lead to
bad behavior, simply don't include the offending entry in the
parent.
* Set the .tinyname flag to 1 by default to indicate that
the entry's name doesn't need freeing. Clear it only when
allocating indirect storage.
* Rename some things to help catch all instances
Change-Id: Iff747b624acbb8e03ed26c24afdf0fc715fd9d99
Moving binding from queued to resolved was messed up if it was the
first queued one and there were other resolved files open at the
time of resolving it.
Dircache info for a directory about to be recursively scanned should
be filled before opening it. Would only affect a directory if it
happened to be opening while it was being initialized.
Change-Id: I26ccf219c382d7caf1424b5ddddc4793e74cb390
As preparation to add new targets to the s5l8702 directory,
rename files as:
s5l8702/ipod6g/*-ipod6g.c -> s5l8702/ipod6g/*-6g.c
Change-Id: I0cd03d6bcf39b2aa198235f9014cb6948bbafcd5
These flags aren't stored for an open file because they're simply
actions for open() to take, corresponding to O_CREAT and O_EXCL.
Just pass the oflag argument along to the deeper call, with some
minor filtering.
Change-Id: Ic8bcfba718ebf4228bdc45de3088af1974820557
* Take out pointless dircache_search; nothing can be reconstructed
with the given info in find_entry_ram(); don't even try there.
Path AND index id must be known. Work it out later.
* Timed yield must be far more often than once every 1/4 second (?!)
* Do better the memory-remaining checks for ramcache load.
* Root separator mustn't be doubled up when searching files.
Change-Id: I091813f4495f3bd0d0c4672bc674df52343b3e48
- unregisters timer on exit, preventing possible crash
- disables synchronization mechanisms when used from an IRQ
- prevents memory allocations from overflowing the audio buffer (unlikely)
Change-Id: I3c2c4ebe93c10ca9176ed0455e7aacc2d10c059e
Also, use rds_reset() now to clear data on station change since
the rds driver internal buffers are used.
Change-Id: I043b09d661eeec21617381015347f0bcead4f7d4
* fmradio.c needs an implementation of tuner_get_rds_info() for the
sim (kill all the sims).
* Some macro bitflags shouldn't be seen unless HAVE_RDS_CAP is
defined.
Change-Id: Idd00c94ca2fc43cf32f9223aa4530d5a02fb3454
* Remove unused bits like the radio event and simplify basic
radio interface. It can be more self-contained with rds.h only
required by radio and tuner code.
* Add post-processing to text a-la Silicon Labs AN243. The chip's
error correction can only do so much; additional checks are highly
recommended. Simply testing for two identical messages in a row
is extremely effective and I've never seen corrupted text since
doing that, even with mediocre reception.
Groups segments must arrive in order, not randomly; logic change
only accepts them in order, starting at 0.
Time readout was made a bit better but really we'd need to use
verbose mode and ensure that no errors were seen during receiving
of time and more checks would be need to have a stable PI. The
text is the important bit anyway.
* Time out of stale text.
* Text is no longer updated until a complete group has been
received, as is specified in the standard. Perhaps go back to
scrolling text lines in the radio screen?
* Add proper character conversion to UTF-8. Only the default G0
table for the moment. The other two could be added in.
* Add variants "RDS_CFG_PROCESS" and "RDS_CFG_PUSH" to allow
the option for processed RDS data to be pushed to the driver and
still do proper post-processing (only text conversion for now for
the latter).
Change-Id: I4d83f8b2e89a209a5096d15ec266477318c66925
I noticed that after booting with the external storage removed,
playing from tagtree, inserting the card, forcing dircache to
reallocate from the debug screen, and trying to reenter tagtree,
it would data abort because the dircache reallaction to a larger
size caused the tagtree buffer to move.
Adjustment to at least one pointer (csi) was missed. Since it's
non-trivial there to determine when things should be NULL and
when they shouldn't, add check for menu too before moving it.
As for the rest, who knows.
Change-Id: Iea6538a2091b4b47083f39296555efc47edf8ba8
Critical reminders about the reasons path_dirname() and
path_basename() do certain things with a given kind of input and
how to interpret them.
Change-Id: I4e6ad29476bdd30abfb644f9360cc7dfd86298df
If a volume root was open at the beginning of a build, its dircache
reference wouldn't be resolved on an already open volume root
directory because the call to do it was simply omitted. Nothing
horribly bad unless a root were opened at mount time and kept open
long term.
Change-Id: I09de30ff8174ad1d14eeeb9539bd23fb51b9e31a
volume_onmount_internal() was being given the next volume to mount
instead of the one just mounted. Only dircache was being notified
for now, which always attempts to scan everything that needs to be
rebuilt, currently making the volume parameter value immaterial.
Put things in the right place and also set the disk sector
multiplier before notifying anybody of the new volume.
Change-Id: Ibc8f26c1d1eca672c753280b49fd8259fde51047
On Windows 64-bit, the size of long is 32-bit, thus any pointer to long cast is
not valid. In any case, one should use intptr_t and ptrdiff_t when casting
to integers. This commit attempts to fix all instances reported by GCC.
When relevant, I replaced code by the macros PTR_ADD, ALIGN_UP from system.h
Change-Id: I2273b0e8465d3c4689824717ed5afa5ed238a2dc
The implementation is not very complicated but there are a few things worth
noting. There was a previous "speaker enable" setting but it was a boolean.
I decided to replace it with a choice setting that has 2 options (on, off)
if headphones cannot be detect on this target, or 3 options (on, off, auto)
if we can detect headphones. This will break the old setting on target that
cannot detect jack but it makes the code more uniform and avoid maintaining
two settings with more #ifdef. The third option (auto) uses the LANG_AUTO
text, which I think is clear enough (disable speaker on jack plug).
In order to avoid code duplication (both in apps and firmware), I decided to
keep the audiohw_enable_speaker function as-is: it takes a boolean and doesn't
care about the speaker policy. I introduced a new audio_enable_speaker that
takes directly the mode (which follows the setting encoding): 0=off, 1=on
and 2=auto. This way one calls audio_enable_speaker and it changes the speaker
once to reflect the request mode. The apps code then uses this function in the
places where it makes sense: on setting load, setting change and jack (un)plug
event.
Change-Id: I027873f698eb4bc365d7c02b515297806355d9e2
...by QStyleOptionViewItem. Yes Qt got it right, in 5.7 they deprecated
QStyleOptionViewItemV4 and recommend using QStyleOptionViewItem which contains
less fields except on newer Qt where it contains all fields. Hopefully it still
works on Qt>4.x for a large enough value of x.
Change-Id: I013c383d2424b04c1c0745f0d7b1d5e62a29d324
The clock structure is identical, and the EMI are the same.
Also fix SSP clock, it was broken on imx233 as well.
Change-Id: I25ec66059b00b1a456ef2f02131d225082536c0a
Because a node ref is at root doesn't make it valid, check that soc is valid
otherwise we return garbage.
Change-Id: I6e5befc959dc670ab39a87484e87af6d90be7726
Running at 130MHz is unsafe since on those targets, we disable memory frequency
scaling because it is unstable. That leads to situation where cpu is running at
64MHz and VDD is at 1.050V. But on STMP3700, the EMI uses the VDD rail instead
of a dedicated VDDMEM rail as on STMP3780. Thus we are essentially running the
EMI at 130MHz at 1.050V when the minimum recommened voltage is 1.2V. This commit
runs the EMI at 64MHz all the time on the ZEN and ZEN X-Fi which will lead to
reduce performance but hopefully increases stability.
Change-Id: Ida6c2ec130b1778973e383d7c44a06a6ca8f9268
This feature was never used and it is not even working because weak linking
doesn't work in-between files in a library.
Change-Id: I389ea5f17be1d9db0e2150828d704be5a091e09d
This is a quick patch to solve FS#13104, we can not disable the
clickwheel LDO from within interrupt code, so for the moment we
leave it enabled all the time, it is unknown how power comsumption
is affected when the hold switch is locked.
Change-Id: I8f675702e2b5becbcd9197c8b044e6b8daeea79f
Unlike the current code, it does no looping to count days or do
table lookups, which means running time doesn't increase with year
or month. A good thing if it's call a lot, especially if the
algorithm were asked to compute dates centuries or more from the
epoch start.
As a bonus, handles negative time values.
Change-Id: I198a23daf621e40623e6b44dacf2387078b4db9c
It is possible to have a thread awoken and subsequently the message
that was placed in the queue has been removed by the time the thread
is able to check the queue. Ensure theads that failed to find a
message do not return prematurely.
It was at worst imprecise when a timeout is specified. It's entirely
incorrect if the function ever returns with SYS_TIMEOUT when using
TIMEOUT_BLOCK.
Change-Id: Ibd41eae8c787adf7a320a24603cf64ff8a6da66a
Chessbox was overflowing GameList[240] causing the board to flip + crash
GameCnt changed to unsigned char which allows the array to roll over
to 0 after 255
define MAX_GAME_CNT 256 and GameList[MAX_GAME_CNT] along with 1 byte GameCnt
should fix this issue
dbg save routine left in for now to help identify any other problems
Added bounds checking to prevent second bug found when loading .pgn files
Change-Id: I2b615c8ecbed4368724412f80ce07346f3cf30a7
Somewhere along the line the screen stopped being cleared prior to
writing new text on each frame, which left visible bits of
previously-displayed text when it changed.
Change-Id: I344e03c234daa77f4e64ed89281c40db887e4498
Fix stuff that was bugging me about the way I did it at first.
While messing around I found RDS code wasn't masking its GPIO
ISR as it should, which might lead to two different interrupts
messing with the static data.
Change-Id: I54626809ea3039a842af0cc9e3e42853326c4193