qmk/qmk_firmware

[Bug] Large external EEPROM fails on AVR

開放

#8,742 建立於 2020年4月9日

 (1 則留言) (0 個反應) (1 位負責人)C (43,867 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (20,368 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Describe the Bug

All the eeprom function signatures provided by avr-libc accept a void* address parameter for the EEPROM offset. This causes problems with AVR when attempting to address 32kB (using signed offsets) or 64kB (when using unsigned).

ChibiOS/ARM reuse the same function signatures to ensure compatibility across the rest of QMK -- these have no issue with addressing as the pointer size is 32-bit.

Suggested fix

  • Rework the persistent storage as a separate subsystem, perhaps called nvram_read_byte() and similar, which provides the same set of functions, but with uint32_t offsets.
  • Relocate things like the Teensy SmartEEPROM to match the current drivers/eeprom/ structure.
  • Relocate the emulated flash to the same location.

貢獻者指南