34 lines
499 B
C
34 lines
499 B
C
|
#define jType_RC 0
|
||
|
//#define jCommand_GPS_location 0
|
||
|
|
||
|
#define NUM_ANALOG_channels 12
|
||
|
|
||
|
typedef struct{
|
||
|
byte type;
|
||
|
byte command;
|
||
|
uint32_t btns;
|
||
|
int16_t analog[NUM_ANALOG_channels];
|
||
|
}nrfRC;
|
||
|
|
||
|
nrfRC RCdata;
|
||
|
|
||
|
void initRCdata(){
|
||
|
|
||
|
}
|
||
|
|
||
|
void RCdataLoop(){
|
||
|
|
||
|
}
|
||
|
|
||
|
void RCdataradioTask(){
|
||
|
memmove(&RCdata, &jRCbuff, sizeof(RCdata));
|
||
|
onData();
|
||
|
}
|
||
|
|
||
|
bool RCgetBTN(byte i){
|
||
|
return (RCdata.btns>>min(31,(int)i))&1;
|
||
|
}
|
||
|
int16_t RCgetAnalog(byte i){
|
||
|
return RCdata.analog[min(NUM_ANALOG_channels-1,(int)i)];
|
||
|
}
|