Add a check to make sure driver enable is set

This commit is contained in:
Kelvin Ly 2020-01-22 07:47:22 -05:00
parent 5f85a3b99e
commit 6b8dc6f337
1 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@ always @(posedge drv_cs_n) begin
end
always @(negedge drv_sck) begin
if (spi_active) begin
if (drv_en & spi_active) begin
cfg[cfg_num] <= cfg[cfg_num] << 1 | drv_sdi;
bit_count <= bit_count + 1;
end
@ -116,7 +116,7 @@ initial begin
$dumpvars;
for (i = 0; i < 5; i += 1) cfg[i] = 0;
// TODO cycle the module long enough to get all the configuration bits
// cycle the module long enough to get all the configuration bits
// written out, and check to see if it worked correctly
i = 0;