mirror of https://github.com/rusefi/bldc.git
Command to get decoded servo value
This commit is contained in:
parent
10bbe73206
commit
e27df0235f
|
@ -35,6 +35,7 @@
|
|||
#include "mcpwm.h"
|
||||
#include "app.h"
|
||||
#include "timeout.h"
|
||||
#include "servo_dec.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
@ -318,6 +319,13 @@ void commands_process_packet(unsigned char *data, unsigned char len) {
|
|||
// Do nothing, just reset the timeout so the motor keeps running.
|
||||
break;
|
||||
|
||||
case COMM_GET_DECODED_PPM:
|
||||
ind = 0;
|
||||
send_buffer[ind++] = COMM_GET_DECODED_PPM;
|
||||
buffer_append_int32(send_buffer, (int32_t)(servodec_get_servo(0) * 1000000.0), &ind);
|
||||
send_packet(send_buffer, ind);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -175,7 +175,8 @@ typedef enum {
|
|||
COMM_EXPERIMENT_SAMPLE,
|
||||
COMM_DETECT_MOTOR_PARAM,
|
||||
COMM_REBOOT,
|
||||
COMM_ALIVE
|
||||
COMM_ALIVE,
|
||||
COMM_GET_DECODED_PPM
|
||||
} COMM_PACKET_ID;
|
||||
|
||||
#endif /* DATATYPES_H_ */
|
||||
|
|
Loading…
Reference in New Issue