Skip to content
Snippets Groups Projects
Commit ef0c43cc authored by fortissBot's avatar fortissBot
Browse files

fixed gamepad and pwm codegen bugs, added init function

refs 7890
parent 9a9bdf5d
No related branches found
No related tags found
No related merge requests found
......@@ -115,19 +115,19 @@ GEN_TYPE_boolean gp_btnR2_read() {
}
GEN_TYPE_double gp_btnLX_read() {
return 0.0;
return ie.btns.js1_lr;
}
GEN_TYPE_double gp_btnLY_read() {
return 0.0;
return ie.btns.js1_ud;
}
GEN_TYPE_double gp_btnRX_read() {
return 0.0;
return ie.btns.js2_lr;
}
GEN_TYPE_double gp_btnRY_read() {
return 0.0;
return ie.btns.js1_ud;
}
// noval
......
......@@ -50,7 +50,7 @@ GEN_TYPE_boolean pwm_initialized = false;
GEN_TYPE_boolean pwm_terminated = false;
void pwm_init(PWM_CHANNEL_T channel) {
// important, since all btns are accessing the same method
// important, since all pwms are accessing the same method
if(!pwm_initialized) {
pwm_channel_values = calloc(sizeof(GEN_TYPE_int), PWM_MAX_NO_CHANNELS);
pwm_channel_enabled = calloc(sizeof(GEN_TYPE_boolean), PWM_MAX_NO_CHANNELS);
......
......@@ -11,6 +11,9 @@
#include "inc/PWM.h"
int main(int argc, char* argv[]) {
// init the system
initialize_system();
// start a gamepad thread
pthread_t pt_gamepad;
pthread_create(&pt_gamepad, NULL, gp_worker, NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment