fix unwrapping of driver pointer

This commit is contained in:
Robert Altner 2022-12-06 21:31:07 +01:00
parent c800ee85b2
commit 6e149606ba
4 changed files with 21 additions and 11 deletions

View file

@ -1,4 +1,4 @@
#include "b15f/wrapper/b15f.h"
#include "../src/wrapper/b15f.h"
#include <stdio.h>
int main() {
@ -10,7 +10,11 @@ int main() {
return -1;
}
uint8_t dip = read_dip_switch(instance, NULL, 0);
uint8_t dip;
if (read_dip_switch(instance, &dip, buf, sizeof(buf)) != 0) {
fprintf(stderr, "%s\n", buf);
return -1;
}
printf("DIP switch reads: ");
for(uint8_t mask = 1; mask != 0; mask <<= 1) {
@ -19,4 +23,4 @@ int main() {
printf("\n");
return 0;
}
}