Skip to content

Commit 2c4fe83

Browse files
committedApr 29, 2021
update readme, change main thread delay logic
1 parent 9e14ab7 commit 2c4fe83

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed
 

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# m8c
22

3-
m8c is a Linux client for Dirtywave M8 tracker's headless mode. It is intended for use with lower end systems like RPi zero.
3+
m8c is a Linux client for Dirtywave M8 tracker's headless mode. It is intended for use with lower end systems like RPi zero. The application should be cross-platform ready and can be built in Mac OS and Windows (with MSYS2/MINGW64).
44

55
Please note that routing the headless M8 USB audio isn't in the scope of this program -- if this is needed, it can be achieved with tools like jackd, alsa\_in and alsa\_out for example. Check out the guide in file AUDIOGUIDE.md for some instructions on routing the audio.
66

@@ -19,7 +19,7 @@ Open Terminal and run the following commands:
1919
### Install required packages
2020

2121
```
22-
sudo apt update && sudo apt install -y git gcc make libsdl2-dev libsdl2-ttf-dev
22+
sudo apt update && sudo apt install -y git gcc make libsdl2-dev libsdl2-ttf-dev libserialport-dev
2323
```
2424

2525
### Download source code

‎main.c

+5-9
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
#include <libserialport.h>
55
#include <signal.h>
66

7-
87
#include "serial.h"
9-
108
#include "command.h"
119
#include "input.h"
1210
#include "render.h"
@@ -63,9 +61,8 @@ int main(int argc, char *argv[]) {
6361
// main loop
6462
while (run) {
6563

66-
//read serial port
67-
size_t bytes_read =
68-
sp_nonblocking_read(port, serial_buf, serial_read_size);
64+
// read serial port
65+
size_t bytes_read = sp_nonblocking_read(port, serial_buf, serial_read_size);
6966
if (bytes_read < 0) {
7067
fprintf(stderr, "Error %zu reading serial. \n", bytes_read);
7168
run = 0;
@@ -79,9 +76,11 @@ int main(int argc, char *argv[]) {
7976
fprintf(stderr, "SLIP error %d\n", n);
8077
}
8178
}
79+
} else {
80+
SDL_Delay(1);
8281
}
8382

84-
//get current inputs
83+
// get current inputs
8584
input_msg_s input = get_input_msg();
8685

8786
switch (input.type) {
@@ -111,9 +110,6 @@ int main(int argc, char *argv[]) {
111110
}
112111

113112
render_screen();
114-
115-
SDL_Delay(1);
116-
117113
}
118114

119115
// exit, clean up

0 commit comments

Comments
 (0)
Please sign in to comment.