Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
YesSanSan opened this issue May 9, 2024 · 0 comments
Open

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

YesSanSan opened this issue May 9, 2024 · 0 comments

Comments

@YesSanSan
Copy link

原文:

`ifdef MODELTECH
localparam CNT_100MS = 32'd2700000;
localparam CNT_120MS = 32'd3240000;
localparam CNT_200MS = 32'd5400000;
`else
// speedup for simulation
localparam CNT_100MS = 32'd27;
localparam CNT_120MS = 32'd32;
localparam CNT_200MS = 32'd54;
`endif

按照 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

然后测试正常。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant