Browse Source

Fixed missing bit-shift to prevent overwriting the busy-bit

Timo Dritschler 3 years ago
parent
commit
ace189b299
1 changed files with 6 additions and 0 deletions
  1. 6 0
      ethernetBridge.c

+ 6 - 0
ethernetBridge.c

@@ -89,6 +89,12 @@ int main(int argc, char *argv[]) {
             uint32_t busy = read_reg_32(bar, REG_BUSY_1BIT); 
             
             if ((busy&0x1) == 0) {
+
+                //Value needs to be stored in bits 1 - 7, because bit 0 is
+                //used as a busy-bit
+                uint32_t write_val = val << 1;
+                write_val = write_val & 0xFF;
+
                 write_reg_32(bar, REG_FREQ_7BIT, val);
             }