Fix gcc warnings in emulator.c
This commit is contained in:
parent
2a2ca57015
commit
7db1ee28e8
|
|
@ -43,18 +43,18 @@ int CLIMenu() {
|
||||||
printf("> ");
|
printf("> ");
|
||||||
do {
|
do {
|
||||||
scanf("%d", &choice);
|
scanf("%d", &choice);
|
||||||
} while (choice < 1 || choice > 7);
|
} while (choice < 1 || choice > 8);
|
||||||
printf("\e[1;1H\e[2J");
|
printf("\033[1;1H\033[2J");
|
||||||
return choice;
|
return choice;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *updateValue(float *curr_value) {
|
void updateValue(float *curr_value) {
|
||||||
printf("Current value: %f\n", *curr_value);
|
printf("Current value: %f\n", *curr_value);
|
||||||
printf("New value: \n");
|
printf("New value: \n");
|
||||||
scanf("%f", curr_value);
|
scanf("%f", curr_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *printState() {
|
void printState() {
|
||||||
printf("\nCurrent state\n");
|
printf("\nCurrent state\n");
|
||||||
printf("RSSI : %f\n", Radio_State.RSSI);
|
printf("RSSI : %f\n", Radio_State.RSSI);
|
||||||
printf("Battery: %f\n", Radio_State.Vbat);
|
printf("Battery: %f\n", Radio_State.Vbat);
|
||||||
|
|
@ -67,8 +67,8 @@ void *printState() {
|
||||||
|
|
||||||
void *startRadio() {
|
void *startRadio() {
|
||||||
systemBootstrap();
|
systemBootstrap();
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
//void *startGUI();
|
|
||||||
|
|
||||||
void *startCLIMenu() {
|
void *startCLIMenu() {
|
||||||
int choice;
|
int choice;
|
||||||
|
|
@ -102,31 +102,28 @@ void *startCLIMenu() {
|
||||||
} while (choice != EXIT);
|
} while (choice != EXIT);
|
||||||
printf("exiting\n");
|
printf("exiting\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
int emulator_main() {
|
int emulator_main() {
|
||||||
pthread_t gui_thread, cli_thread, radio_thread;
|
pthread_t cli_thread, radio_thread;
|
||||||
int err1, err2;
|
int err1, err2 = 0;
|
||||||
|
|
||||||
err1 = pthread_create(&cli_thread, NULL, startCLIMenu, NULL);
|
err1 = pthread_create(&cli_thread, NULL, startCLIMenu, NULL);
|
||||||
//err2 = pthread_create(&gui_thread, NULL, startGUI, NULL);
|
err2 = pthread_create(&radio_thread, NULL, startRadio, NULL);
|
||||||
|
|
||||||
if (err1) {
|
if (err1 | err2) {
|
||||||
printf("An error occurred starting the threads: %d, %d\n", err1, err2);
|
printf("An error occurred starting the threads: %d, %d\n", err1, err2);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
//pthread_join(gui_thread, NULL);
|
|
||||||
pthread_create(&radio_thread, NULL, startRadio, NULL);
|
|
||||||
pthread_join(cli_thread, NULL);
|
pthread_join(cli_thread, NULL);
|
||||||
|
|
||||||
|
|
||||||
printf("73\n");
|
printf("73\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void *entry() {
|
void entry() {
|
||||||
__asm__(
|
__asm__(
|
||||||
"xorl %ebp, %ebp\n\t"
|
"xorl %ebp, %ebp\n\t"
|
||||||
"mov %RDX, %R9\n\t"
|
"mov %RDX, %R9\n\t"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue