tillitis / tillitis-key1

Board designs, FPGA verilog, firmware for TKey, the flexible and open USB security key 🔑
https://www.tillitis.se
382 stars 24 forks source link

Memory map constants as defines #161

Closed mchack-work closed 3 months ago

mchack-work commented 4 months ago

Turning on -W pedantic shows us that our memory constants can't fit in an enum in ISO C. Not a real problem for GNU99 but makes it hard to run -W pedantic to find other problems.

I propose we change the memory constants from an enum into pre-processor defines instead and use simple direct values for the memory addresses instead of computing them.

We also turn on pedantic warnings but allow inline asm as the GNU extension we mostly use and fix missing void parameter declarations that pedantic warned us about.

Please review carefully that have all the addresses defined.

Also note that tk1_mem.h is also used in tkey-libs and qemu.

Closes #159

mchack-work commented 3 months ago

We actually don't know if someone is using _BASE. We don't, but someone else might. Better to include them. Nice catch.

dehanj commented 3 months ago

Rebased on main, and removed a trailing whitespace. Will merge when CI goes through.