Skip to content

Commit

Permalink
Better naming for pulse states.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfjlaros committed Mar 13, 2023
1 parent 91bd359 commit bceb383
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/mzf2wav.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ char const usage_[] =
" -s SPEED turbo mode speed 0, 1 or 2 (default: 0)\n"
" -N FMT custom waveform for normal mode\n"
" -S FMT custom waveform for turbo mode\n\n"
"FMT: long_up,long_down,short_up,short_down\n";
"FMT: long_high,long_low,short_high,short_low\n";

char const version_[] =
"MZF2WAV version 2.0.0\n"
Expand Down
12 changes: 6 additions & 6 deletions src/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@


void writeLongPulse_(FILE *const output, uint32_t *size, PCP pulseConfig) {
for (uint16_t i = 0; i < pulseConfig->longPulse.up; ++i) {
for (uint16_t i = 0; i < pulseConfig->longPulse.high; ++i) {
writeBit(output, false, pulseConfig->invert);
}
for (uint16_t i = 0; i < pulseConfig->longPulse.down; ++i) {
for (uint16_t i = 0; i < pulseConfig->longPulse.low; ++i) {
writeBit(output, true, pulseConfig->invert);
}
*size += pulseConfig->longPulse.up + pulseConfig->longPulse.down;
*size += pulseConfig->longPulse.high + pulseConfig->longPulse.low;
}

void writeShortPulse_(FILE *const output, uint32_t *size, PCP pulseConfig) {
for (uint16_t i = 0; i < pulseConfig->shortPulse.up; ++i) {
for (uint16_t i = 0; i < pulseConfig->shortPulse.high; ++i) {
writeBit(output, false, pulseConfig->invert);
}
for (uint16_t i = 0; i < pulseConfig->shortPulse.down; ++i) {
for (uint16_t i = 0; i < pulseConfig->shortPulse.low; ++i) {
writeBit(output, true, pulseConfig->invert);
}
*size += pulseConfig->shortPulse.up + pulseConfig->shortPulse.down;
*size += pulseConfig->shortPulse.high + pulseConfig->shortPulse.low;
}


Expand Down
4 changes: 2 additions & 2 deletions src/write.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "wav.h"

typedef struct {
uint16_t up; //!< Pulse high count.
uint16_t down; //!< Pulse low count.
uint16_t high; //!< Pulse high count.
uint16_t low; //!< Pulse low count.
} Pulse;

typedef struct {
Expand Down

0 comments on commit bceb383

Please sign in to comment.