system76 / ec

System76 Open Source Embedded Controller
GNU General Public License v3.0
318 stars 72 forks source link

Use a 16-bit system tick #483

Closed crawfxrd closed 1 month ago

crawfxrd commented 1 month ago

The maximum interval when configured for a 1ms tick:

The value is used for scheduling and timeouts, and not to track the uptime of the system, so the 32-bit value is excessive.

oryp6 ec.mem diff ```diff --- 0/ec.mem 2024-07-12 06:53:03.449950127 -0600 +++ 1/ec.mem 2024-07-12 06:53:15.068179591 -0600 @@ -1,11 +1,11 @@ Internal RAM layout: 0 1 2 3 4 5 6 7 8 9 A B C D E F -0x00:|0|0|0|0|0|0|0|0|a|a|a|a|b|b|b|b| -0x10:|b|b|c|c|c|c|c|c|c|c|c|c|c|e|g| | -0x20:|B|B|B|d|d|d|d|f|f|f|f|f|f|f|f|f| -0x30:|f|f|f|f|f|f|f|f|f|f|f|f|f|f|f|f| -0x40:|f|f|f|f|f|f|h|h|h|h|h|h|h|h|h|h| -0x50:|Q|Q|Q|Q|Q|S|S|S|S|S|S|S|S|S|S|S| +0x00:|0|0|0|0|0|0|0|0|a|a|a|a|a|a|b|b| +0x10:|b|b|b|b|b|b|b|b|b|c|c|c|c|e| | | +0x20:|B|B|B|d|d|d|d|d|d|d|d|d|d|d|d|d| +0x30:|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d| +0x40:|d|d|f|f|f|f|f|f|f|f|f|f|Q|Q|Q|Q| +0x50:|Q|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0x60:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0x70:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0x80:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| @@ -18,12 +18,12 @@ 0xf0:|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S|S| 0-3:Reg Banks, T:Bit regs, a-z:Data, B:Bits, Q:Overlay, I:iData, S:Stack, A:Absolute -Stack starts at: 0x55 (sp set to 0x54) with 171 bytes available. -The largest spare internal RAM space starts at 0x1f with 1 byte available. +Stack starts at: 0x51 (sp set to 0x50) with 175 bytes available. +The largest spare internal RAM space starts at 0x1e with 2 bytes available. Other memory: Name Start End Size Max ---------------- -------- -------- -------- -------- PAGED EXT. RAM 0 256 - EXTERNAL RAM 0x0001 0x0526 1318 2048 - ROM/EPROM/FLASH 0x0000 0x9113 36750 65536 + EXTERNAL RAM 0x0001 0x0518 1304 2048 + ROM/EPROM/FLASH 0x0000 0x8f8d 36206 65536 ```