Skip to content

Commit 83288b3

Browse files
committed
pcm3168 nameing conflics
1 parent c0d1145 commit 83288b3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/Driver/pcm3168/pcm3168.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class PCM3168 {
108108
bool setVolume(float level) { return volumeInteger(volumebyte(level)); }
109109

110110
bool setVolume(int channel, float level) {
111-
if (channel < 1 || channel > DAC_CHANNELS) return false;
111+
if (channel < 1 || channel > DAC_CHANNELS_MAX) return false;
112112
return volumeInteger(channel, volumebyte(level));
113113
}
114114

@@ -117,7 +117,7 @@ class PCM3168 {
117117
}
118118

119119
bool setInputVolume(int channel, float level) {
120-
if (channel < 1 || channel > DAC_CHANNELS) return false;
120+
if (channel < 1 || channel > DAC_CHANNELS_MAX) return false;
121121
return inputLevelInteger(channel, inputlevelbyte(level));
122122
}
123123

@@ -131,8 +131,8 @@ class PCM3168 {
131131

132132
protected:
133133
const uint8_t I2C_BASE = 0x44;
134-
const int ADC_CHANNELS = 6;
135-
const int DAC_CHANNELS = 8;
134+
const int ADC_CHANNELS_MAX = 6;
135+
const int DAC_CHANNELS_MAX = 8;
136136
TwoWire *wire = &Wire;
137137
uint8_t i2c_addr = I2C_BASE;
138138
FMT fmt;
@@ -163,24 +163,24 @@ class PCM3168 {
163163
bool volumeInteger(int channel, uint32_t n) {
164164
bool rv = false;
165165

166-
if (0 != channel && channel <= DAC_CHANNELS)
166+
if (0 != channel && channel <= DAC_CHANNELS_MAX)
167167
rv = write(DAC_ATTENUATION_BASE + channel - 1, n);
168168

169169
return rv;
170170
}
171171

172172
bool inputLevelInteger(int32_t n) {
173-
uint8_t levels[ADC_CHANNELS];
173+
uint8_t levels[ADC_CHANNELS_MAX];
174174

175-
for (int i = 0; i < ADC_CHANNELS; i++) levels[i] = n;
175+
for (int i = 0; i < ADC_CHANNELS_MAX; i++) levels[i] = n;
176176

177-
return write(ADC_ATTENUATION_BASE, levels, ADC_CHANNELS);
177+
return write(ADC_ATTENUATION_BASE, levels, ADC_CHANNELS_MAX);
178178
}
179179

180180
bool inputLevelInteger(int channel, int32_t n) {
181181
bool rv = false;
182182

183-
if (0 != channel && channel <= ADC_CHANNELS)
183+
if (0 != channel && channel <= ADC_CHANNELS_MAX)
184184
rv = write(ADC_ATTENUATION_BASE + channel - 1, n);
185185

186186
return rv;

0 commit comments

Comments
 (0)