File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -190,3 +190,4 @@ pip-log.txt
190
190
191
191
# Mac crap
192
192
.DS_Store
193
+ * .cpp~
Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ void MiniGen::setMode(MODE newMode)
77
77
configReg |=0x0000 ;
78
78
break ;
79
79
}
80
+
81
+ // Make sure to clear the top two bit to make sure we're writing the config register:
82
+ configReg &= ~0xC000 ;
83
+
80
84
SPIWrite (configReg); // Now write our shadow copy to the part.
81
85
}
82
86
@@ -90,6 +94,10 @@ void MiniGen::selectFreqReg(FREQREG reg)
90
94
if (reg == FREQ0) configReg &= ~0x0800 ;
91
95
// Otherwise, set bit 11.
92
96
else configReg |= 0x0800 ;
97
+
98
+ // Make sure to clear the top two bit to make sure we're writing the config register:
99
+ configReg &= ~0xC000 ;
100
+
93
101
SPIWrite (configReg);
94
102
}
95
103
@@ -99,6 +107,10 @@ void MiniGen::selectPhaseReg(PHASEREG reg)
99
107
{
100
108
if (reg == PHASE0) configReg &= ~0x0400 ;
101
109
else configReg |= 0x0400 ;
110
+
111
+ // Make sure to clear the top two bit to make sure we're writing the config register:
112
+ configReg &= ~0xC000 ;
113
+
102
114
SPIWrite (configReg);
103
115
}
104
116
@@ -128,6 +140,10 @@ void MiniGen::setFreqAdjustMode(FREQADJUSTMODE newMode)
128
140
configReg |= 0x2000 ;
129
141
break ;
130
142
}
143
+
144
+ // Make sure to clear the top two bit to make sure we're writing the config register:
145
+ configReg &= ~0xC000 ;
146
+
131
147
SPIWrite (configReg);
132
148
}
133
149
You can’t perform that action at this time.
0 commit comments