Subversion Repositories FlightCtrl

Rev

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

Rev 1651 Rev 1652
Line 66... Line 66...
66
SIGNAL (TWI_vect)
66
SIGNAL (TWI_vect)
67
//############################################################################
67
//############################################################################
68
{
68
{
69
        static unsigned char missing_motor = 0, byte_counter = 0, crc = 0, read_more = 0, motorread_temperature = 0;
69
        static unsigned char missing_motor = 0, byte_counter = 0, crc = 0, read_more = 0, motorread_temperature = 0;
70
        static unsigned char *pTxBuff;
70
        static unsigned char *pTxBuff;
71
 
-
 
72
J4High;
71
J4High;
73
        switch(twi_state++)
72
        switch(twi_state++)
74
        {
73
        {
75
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
74
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
76
// Writing the Data
75
// Writing the Data
Line 85... Line 84...
85
                        }
84
                        }
86
                                else i2c_write_byte(0x52+(motor*2));
85
                                else i2c_write_byte(0x52+(motor*2));
87
                        break;
86
                        break;
88
                case 1:
87
                case 1:
89
                        i2c_write_byte(Motor[motor].SetPoint);
88
                        i2c_write_byte(Motor[motor].SetPoint);
90
                        if(!(Motor[motor].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) )
89
                        if(!(Motor[motor].Version & MOTOR_STATE_NEW_PROTOCOL_MASK) || RequiredMotors > 6)
91
                        {
90
                        {
92
                                twi_state = 4; //jump over sending more data
91
                                twi_state = 4; //jump over sending more data
93
                        }
92
                        }
94
                        else if(!(Motor[motor].SetPointLowerBits || (BLFlags & BLFLAG_SEND_CONFIG)))
93
                        else if(!(Motor[motor].SetPointLowerBits || (BLFlags & BLFLAG_SEND_CONFIG)))
95
                        {
94
                        {