Skip to content
This repository was archived by the owner on May 22, 2021. It is now read-only.

Commit 1037c70

Browse files
committed
Improve comments
1 parent bbb190c commit 1037c70

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

uart-sound.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
7474
Baudrate: 2 000 000
7575
Data bitrate: 1 600 000
7676
Samplerate: 25 000
77-
Bits per sample: 64 (32 + 8 1/0 transitions)
77+
Bits per sample: 64 (64 + 8 implicit 1/0 transitions)
7878
Bytes per sample: 8
7979
8080
*/
@@ -88,7 +88,7 @@ int main(int argc, char *argv[])
8888
int16_t sample = audio_buffer[i];
8989

9090
if (mode == MODE_PDM) {
91-
// Emulate PDM
91+
// Encode as PDM
9292
int k_iter = 8;
9393
for (k = 0; k < k_iter; k++) {
9494
uint8_t out = 0;
@@ -135,7 +135,7 @@ int main(int argc, char *argv[])
135135

136136
samples_out += k_iter;
137137
} else if (mode == MODE_PWM32) {
138-
// Emulate 32 bit PWM - works ok at 1 000 000 baud
138+
// Encode as 32 bit PWM - works ok at 1 000 000 baud
139139
// 1000000 // 10 * 8 // 32 = 25000 Hz
140140
// 32 bits = 4 bytes
141141

@@ -149,7 +149,7 @@ int main(int argc, char *argv[])
149149
samples_out = 0;
150150
}
151151
} else if (mode == MODE_PWM64) {
152-
// Emulate 64 bit PWM - works ok at 2 000 000 baud
152+
// Encode as 64 bit PWM - works ok at 2 000 000 baud
153153
// 2000000 // 10 * 8 // 64 = 25000 Hz
154154
// 64 bits = 8 bytes
155155

0 commit comments

Comments
 (0)