summaryrefslogtreecommitdiff
path: root/keyboards/nk65/config.h
diff options
context:
space:
mode:
authoryiancar <yiangosyiangou@cytanet.com.cy>2020-11-02 19:09:48 +0000
committerGitHub <noreply@github.com>2020-11-03 06:09:48 +1100
commit4b839db3841f001f78291373b2b6c3eca34582ed (patch)
treebba345e493bad7ceda76222402cf5bc0f8b4f09b /keyboards/nk65/config.h
parente041ec1655f49ce756a2949a367f8ae7c92a9635 (diff)
NK65 eeprom compatibility with 128KB and 256KB (#10804)
* NK65 define hack for 128kb 256kb versions of F303 * Updated to chibios define
Diffstat (limited to 'keyboards/nk65/config.h')
-rwxr-xr-xkeyboards/nk65/config.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/keyboards/nk65/config.h b/keyboards/nk65/config.h
index 826e54180c..f9845f6789 100755
--- a/keyboards/nk65/config.h
+++ b/keyboards/nk65/config.h
@@ -144,3 +144,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE
+
+/* Custom EEPROM start addressing. This is to support
+ * both 128kb and 256kb versions of F303.
+ * Register 0x1FFFF7CC holds the size of the flash memory.
+ */
+#define EEPROM_START_ADDRESS
+#define FEE_MCU_FLASH_SIZE \
+({ \
+ uint16_t (*flash_size) = (uint16_t*)FLASHSIZE_BASE; \
+ *flash_size; \
+})