Subversion Repositories FlightCtrl

Rev

Rev 1486 | Rev 1639 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1486 Rev 1638
Line 21... Line 21...
21
extern volatile unsigned char twi_state;
21
extern volatile unsigned char twi_state;
22
extern unsigned char motor,MissingMotor;
22
extern unsigned char motor,MissingMotor;
23
extern unsigned char motorread;
23
extern unsigned char motorread;
Line 24... Line 24...
24
 
24
 
25
#define MAX_MOTORS      12
25
#define MAX_MOTORS      12
26
#define MOTOR_STATE_PRESENT_MASK        0x80
26
#define MOTOR_STATE_PRESENT_MASK                0x80
-
 
27
#define MOTOR_STATE_ERROR_MASK                  0x7F
-
 
28
 
-
 
29
 
Line 27... Line 30...
27
#define MOTOR_STATE_ERROR_MASK          0x7F
30
#define MOTOR_STATE_NEW_PROTOCOL_MASK   0x01
28
 
31
 
29
typedef struct
32
typedef struct
30
{
33
{
31
        unsigned char SetPoint; // written by attitude controller
34
        unsigned char SetPoint; // written by attitude controller
32
        unsigned char State;    // 7 bit for I2C error counter, highest bit indicates if motor is present
35
        unsigned char State;    // 7 bit for I2C error counter, highest bit indicates if motor is present
-
 
36
        unsigned char Current;  // in 0.1 A steps, read back from BL
-
 
37
        unsigned char MaxPWM;   // read back from BL is less than 255 if BL is in current limit
-
 
38
          signed char Temperature; // old BL-Ctrl will return a 255 here 
33
        unsigned char Current;  // in 0.1 A steps, read back from BL
39
        unsigned char SetPointLowerBits; // for higher Resolution
Line 34... Line 40...
34
        unsigned char MaxPWM;   // read back from BL is less than 255 if BL is in current limit
40
    unsigned char Version;
Line 35... Line 41...
35
} __attribute__((packed)) MotorData_t;
41
} __attribute__((packed)) MotorData_t;