sipeed / TangNano-9K-example

TangNano-9K-example project
227 stars 70 forks source link

spi_lcd 中的 `ifdef MODELTECH 似乎是错的 #27

Open YesSanSan opened 6 months ago

YesSanSan commented 6 months ago

原文: https://github.com/sipeed/TangNano-9K-example/blob/c3b795799f23de91982be52db4273a8eea100cdb/spi_lcd/src/top.v#L104-L117 按照 https://stackoverflow.com/a/16745244 的回答,这个宏定义的名称应该是 MODEL_TECH ,而且 if-else 写反了,最后仿真下是正常的,但实际烧录后会无法正确复位。刚上电屏幕能正常显示,复位后就不显示了。 改为:

`ifdef MODEL_TECH

    // speedup for simulation
    localparam CNT_100MS = 32'd27;
    localparam CNT_120MS = 32'd32;
    localparam CNT_200MS = 32'd54;

`else

    localparam CNT_100MS = 32'd2700000;
    localparam CNT_120MS = 32'd3240000;
    localparam CNT_200MS = 32'd5400000;

`endif

然后测试正常。