OLIMEX / DIY-LAPTOP

Do It Yourself Open Source Hardware and Software Modular Hacker's Friendly Laptop
Apache License 2.0
495 stars 89 forks source link

teres1-audioselect: check for read > 0, loop and cosmetic #15

Closed khumarahn closed 6 years ago

khumarahn commented 6 years ago

Hi,

I made changes similar to those in teres1-ledctrl.

I removed installation of systemd service files from Makefile. I think they need to be handled separately. My system does not even have systemd.

d3v1c3nv11 commented 6 years ago

Thank you for the feedback! I re-wrote this service, and included your suggestions. You can see it here: https://github.com/d3v1c3nv11/teres1-audioselect
It needs few days of testing before merging to master branch. You can test it too in gentoo and tell me if it is alright. Thank you again for the contribution.

khumarahn commented 6 years ago

ok, thanks. I should be able to look at it later closely. Now, there is some compilation error:

$ make
cc teres1-audioselect.c -o teres1-audioselect
teres1-audioselect.c: In function ‘main’:
teres1-audioselect.c:84:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘off_t’
     off_t offset = SUNXI_HMIC_STS;
     ^
teres1-audioselect.c:125:19: error: ‘ie’ undeclared (first use in this function)
   while(read(fd, &ie, sizeof(struct input_event))>0)
                   ^
teres1-audioselect.c:125:19: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:2: all] Error 1

also, if you could use some consistent indentation, this would really help

d3v1c3nv11 commented 6 years ago

oups - corrected