summaryrefslogtreecommitdiff
path: root/supervisor
AgeCommit message (Collapse)Author
2020-09-13Update safe_mode.cmicroDev
2020-09-13Update safe mode reasonmicroDev
2020-09-14Small improvements to the dictionary compressionTaku Fukada
2020-09-12compression: Implement ciscorn's dictionary approachJeff Epler
Massive savings. Thanks so much @ciscorn for providing the initial code for choosing the dictionary. This adds a bit of time to the build, both to find the dictionary but also because (for reasons I don't fully understand), the binary search in the compress() function no longer worked and had to be replaced with a linear search. I think this is because the intended invariant is that for codebook entries that encode to the same number of bits, the entries are ordered in ascending value. However, I mis-placed the transition from "words" to "byte/char values" so the codebook entries for words are in word-order rather than their code order. Because this price is only paid at build time, I didn't care to determine exactly where the correct fix was. I also commented out a line to produce the "estimated total memory size" -- at least on the unix build with TRANSLATION=ja, this led to a build time KeyError trying to compute the codebook size for all the strings. I think this occurs because some single unicode code point ('ァ') is no longer present as itself in the compressed strings, due to always being replaced by a word. As promised, this seems to save hundreds of bytes in the German translation on the trinket m0. Testing performed: - built trinket_m0 in several languages - built and ran unix port in several languages (en, de_DE, ja) and ran simple error-producing codes like ./micropython -c '1/0'
2020-09-12Fix serial console output & add more boardsmicroDev
2020-09-11Added esp32s2 safe_mode & fixed user_safe_modemicroDev
2020-09-10Merge pull request #3370 from jepler/compression-bigramsScott Shawcroft
add bigram compression to makeqstrdata (save ~100 bytes on trinket m0 de_DE)
2020-09-08Fix decompression of unicode values above 2047Jeff Epler
Two problems: The lead byte for 3-byte sequences was wrong, and one mid-byte was not even filled in due to a missing "++"! Apparently this was broken ever since the first "Compress as unicode, not bytes" commit, but I believed I'd "tested" it by running on the Pinyin translation. This rendered at least the Korean and Japanese translations completely illegible, affecting 5.0 and all later releases.
2020-09-08translations: Make decompression clearerJeff Epler
Now this gets filled in with values e.g., 128 (0x80) and 159 (0x9f).
2020-09-08Fix heap without PSRAM. Never set heap_size.Scott Shawcroft
2020-09-03Merge remote-tracking branch 'adafruit/main' into native_wifiScott Shawcroft
2020-09-02Merge pull request #3344 from jepler/issue-3184Scott Shawcroft
Fix RGBMatrix, FrameBufferDisplay bugs
2020-09-01add bigram compression to makeqstrdataJeff Epler
Compress common unicode bigrams by making code points in the range 0x80 - 0xbf (inclusive) represent them. Then, they can be greedily encoded and the substituted code points handled by the existing Huffman compression. Normally code points in the range 0x80-0xbf are not used in Unicode, so we stake our own claim. Using the more arguably correct "Private Use Area" (PUA) would mean that for scripts that only use code points under 256 we would use more memory for the "values" table. bigram means "two letters", and is also sometimes called a "digram". It's nothing to do with "big RAM". For our purposes, a bigram represents two successive unicode code points, so for instance in our build on trinket m0 for english the most frequent are: ['t ', 'e ', 'in', 'd ', ...]. The bigrams are selected based on frequency in the corpus, but the selection is not necessarily optimal, for these reasons I can think of: * Suppose the corpus was just "tea" repeated 100 times. The top bigrams would be "te", and "ea". However, overlap, "te" could never be used. Thus, some bigrams might actually waste space * I _assume_ this has to be why e.g., bigram 0x86 "s " is more frequent than bigram 0x85 " a" in English for Trinket M0, because sequences like "can't add" would get the "t " digram and then be unable to use the " a" digram. * And generally, if a bigram is frequent then so are its constituents. Say that "i" and "n" both encode to just 5 or 6 bits, then the huffman code for "in" had better compress to 10 or fewer bits or it's a net loss! * I checked though! "i" is 5 bits, "n" is 6 bits (lucky guess) but the bigram 0x83 also just 6 bits, so this one is a win of 5 bits for every "it" minus overhead. Yay, this round goes to team compression. * On the other hand, the least frequent bigram 0x9d " n" is 10 bits long and its constituent code points are 4+6 bits so there's no savings, but there is the cost of the table entry. * and somehow 0x9f 'an' is never used at all! With or without accounting for overlaps, there is some optimum number of bigrams. Adding one more bigram uses at least 2 bytes (for the entry in the bigram table; 4 bytes if code points >255 are in the source text) and also needs a slot in the Huffman dictionary, so adding bigrams beyond the optimim number makes compression worse again. If it's an improvement, the fact that it's not guaranteed optimal doesn't seem to matter too much. It just leaves a little more fruit for the next sweep to pick up. Perhaps try adding the most frequent bigram not yet present, until it doesn't improve compression overall. Right now, de_DE is again the "fullest" build on trinket_m0. (It's reclaimed that spot from the ja translation somehow) This change saves 104 bytes there, increasing free space about 6.8%. In the larger (but not critically full) pyportal build it saves 324 bytes. The specific number of bigrams used (32) was chosen as it is the max number that fit within the 0x80..0xbf range. Larger tables would require the use of 16 bit code points in the de_DE build, losing savings overall. (Side note: The most frequent letters in English have been said to be: ETA OIN SHRDLU; but we have UAC EIL MOPRST in our corpus)
2020-09-01supervisor: Always allocate at least a 1x1 terminalJeff Epler
Otherwise, out of range writes would occur in tilegrid_set_tile, causing a safe mode reset. ``` Hardware watchpoint 6: -location *stack_alloc->ptr Old value = 24652061 New value = 24641565 0x000444f2 in common_hal_displayio_tilegrid_set_tile (self=0x200002c8 <supervisor_terminal_text_grid>, x=1, y=1, tile_index=0 '\000') at ../../shared-module/displayio/TileGrid.c:236 236 if (!self->partial_change) { (gdb) ```
2020-08-30merge from upstreamDan Halbert
2020-08-27Merge remote-tracking branch 'adafruit/main' into native_wifiScott Shawcroft
2020-08-25Merge pull request #3318 from jepler/interrupt-serial-rxJeff Epler
supervisor: check for interrupt during rx_chr
2020-08-25Merge remote-tracking branch 'adafruit/main' into native_wifiScott Shawcroft
2020-08-24Fix RGB LED useScott Shawcroft
2020-08-23supervisor: use mp_handle_pending to check for exceptionsJeff Epler
2020-08-23WIP supervisor: check for interrupt during rx_chrJeff Epler
2020-08-21Merge remote-tracking branch 'adafruit/main' into ble_hciDan Halbert
2020-08-20merge from upstream; working; includes debug_out code for debugging via ↵Dan Halbert
Saleae for posterity
2020-08-19Add usb-endpoint-count checkingJeff Epler
.. however, the number of endpoints is only set for SAMD (8). Other ports need to set the value. Otherwise, the build will show the message ``` Unable to check whether maximum number of endpoints is respected ```
2020-08-19Disable wifi debug logging and memory logScott Shawcroft
2020-08-19Add debugging. Scanning doesn't crash but returns no results. Need to config ↵Scott Shawcroft
station.
2020-08-19Scanning WIP. Need to sort out supervisor memoryScott Shawcroft
2020-08-17Turn off terminalio for ja and koScott Shawcroft
The font is missing many characters and the build needs the space. We can optimize font storage when we get a good font. The serial output will work as usual.
2020-08-12Fix build errors when SHARPDISPLAY && !RGBMATRIXJeff Epler
2020-08-12sharpmemory: Implement support for Sharp Memory Displays in framebufferioJeff Epler
2020-08-11Merge pull request #3232 from hierophect/esp32-neopixelScott Shawcroft
ESP32-S2: Add Neopixel support
2020-08-10Add skip for rgb matrix exception handlingLucian Copeland
2020-08-10Fix neopixel macro issue, set default neopixel colorLucian Copeland
2020-08-05Fix pwm reset spew, protect against null reference in led statusLucian Copeland
2020-08-04Rework build flags, prevent idf errorsLucian Copeland
2020-08-04safe_mode: Exclude NORDIC_SOFT_DEVICE_ASSERT str if possibleJeff Epler
2020-08-02wip: compilesDan Halbert
2020-07-30Merge pull request #3225 from hathach/improve-highspeed-usbJeff Epler
Improve highspeed usb
2020-07-29Merge pull request #3223 from dhalbert/unmount-before-resetScott Shawcroft
storage.erase_filesystem(): disconnect from USB and wait 1 second before resetting
2020-07-29move CFG_TUSB_RHPORT0_MODE into generated headerhathach
2020-07-29remove obsolete CFG in tusb_config.hhathach
2020-07-29replace USB_MSC_MAX_PACKET_SIZE with USB_HIGHSPEED in descriptor gen toolhathach
2020-07-28storage.erase_filesystem(): unmount and wait 1 second before resettingDan Halbert
2020-07-22Add externs. GCC10 complains about duplicate definesScott Shawcroft
2020-07-20supervisor: rename some locals for clarityJeff Epler
It's perfectly OK for these variables with static linkage to have the same name, but it's inconvenient for humans like me.
2020-07-20background callbacks: Clear any callbacks that were queuedJeff Epler
Before this, a background callback that was on the list when background_callback_reset was called could have ended up in a state that made it "un-queueable": its "prev" pointer could have been non-NULL.
2020-07-17background_callback_gc_collect: We must traverse the whole listJeff Epler
2020-07-17background_callback: Add gc collect callbackJeff Epler
A background callback must never outlive its related object. By collecting the head of the linked list of background tasks, this will not happen. One hypothetical case where this could happen is if an MP3Decoder is deleted while its callback to fill its buffer is scheduled.
2020-07-15supervisor: usb: note that it's unusual to need to call usb_backgroundJeff Epler
2020-07-15supervisor: factor supervisor_background_tasks from sundry portsJeff Epler