Skip to content

Commit

Permalink
Enable all P values for M72 command.
Browse files Browse the repository at this point in the history
If any should be blocked, it should be done at the side of Sailfish.
  • Loading branch information
DrLex0 committed Apr 3, 2023
1 parent 28f3460 commit 4cdb0ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gpx/gpx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2115,8 +2115,9 @@ static int queue_song(Gpx *gpx, unsigned song_id)
// song ID 0: error tone with 4 cycles
// song ID 1: done tone
// song ID 2: error tone with 2 cycles
// ... see Sailfish source for the rest.

assert(song_id <= 2);
assert(song_id <= 255);

begin_frame(gpx);

Expand Down Expand Up @@ -5164,7 +5165,7 @@ int gpx_convert_line(Gpx *gpx, char *gcode_line)
case 72:
if(gpx->command.flag & P_IS_SET) {
unsigned song_id = (unsigned)gpx->command.p;
if(song_id > 2) song_id = 2;
if(song_id > 255) song_id = 2;
CALL( queue_song(gpx, song_id) );
command_emitted++;
}
Expand Down

0 comments on commit 4cdb0ea

Please sign in to comment.