Revert "Hard code the osc6 programmed on nanofury for now." This reverts commit c31cb6d09aa0cd302efd527a160322980d14b97b.
diff --git a/libbitfury.c b/libbitfury.c
index 80d5ae5..37861f0 100644
--- a/libbitfury.c
+++ b/libbitfury.c
@@ -163,8 +163,10 @@ void spi_config_reg(struct bitfury_info *info, int cfgreg, int ena)
void spi_set_freq(struct bitfury_info *info)
{
- unsigned char osc6[8] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00 };
+ uint64_t freq;
+ const uint8_t *osc6 = (unsigned char *)&freq;
+ freq = (1ULL << info->osc6_bits) - 1ULL;
spi_add_data(info, 0x6000, osc6, 8); /* Program internal on-die slow oscillator frequency */
}