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 addresses in memory map outside of enum range #159

Closed mchack-work closed 3 months ago

mchack-work commented 4 months ago

According to ISO C enum values should be within int range. Many values in tk1_mem.h (in tillitis-key1 and in tkey-libs) are outside range. It seems that clang with the flags used in compiling makes this OK, but perhaps we should take action.

One idea is just to use #define instead. And perhaps even just use hardcoded values instead of oring together stuff for ease of porting to other languages?

Note that tk1_mem.h also lives in tkey-libs repo but main location is here.