Subversion Repositories FlightCtrl

Compare Revisions

Ignore whitespace Rev 1662 → Rev 1663

/beta/Code Redesign killagreg/libfc644.a
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/beta/Code Redesign killagreg/twimaster.c
199,7 → 199,7
// send read mode and the lower bits of setpoint
I2C_WriteByte((BLReadMode<<3)|(Motor[motor_write].SetPointLowerBits & 0x07));
// configuration tranmission request?
if((0x0001<<motor_read) & BLConfig_WriteMask)
if((0x0001<<motor_write) & BLConfig_WriteMask)
{ // redirect tx pointer to configuration data
pBuff = (uint8_t*)&BLConfig; // select config for motor
BuffLen = sizeof(BLConfig_t);
379,9 → 379,11
 
if(FCFlags & FCFLAG_MOTOR_RUN) return(0); // not when motors are running!
if(motor > MAX_MOTORS) return (0); // motor does not exist!
if(!(Motor[motor].State & MOTOR_STATE_PRESENT_MASK)) return(0); // motor does not exist!
if(!(Motor[motor].Version & MOTOR_STATE_NEW_PROTOCOL_MASK)) return(0); // not a new BL!
 
if(motor)
{
if(!(Motor[motor-1].State & MOTOR_STATE_PRESENT_MASK)) return(0); // motor does not exist!
if(!(Motor[motor-1].Version & MOTOR_STATE_NEW_PROTOCOL_MASK)) return(0); // not a new BL!
}
// check BL configuration to send
if(BLConfig.Revision != BLCONFIG_REVISION) return (0); // bad revison
i = RAM_Checksum((uint8_t*)&BLConfig, sizeof(BLConfig_t) - 1);
424,8 → 426,8
 
if(FCFlags & FCFLAG_MOTOR_RUN) return(0); // not when motors are running!
if((motor == 0) || (motor > MAX_MOTORS)) return (0); // motor does not exist!
if(!(Motor[motor].State & MOTOR_STATE_PRESENT_MASK)) return(0); // motor does not exist!
if(!(Motor[motor].Version & MOTOR_STATE_NEW_PROTOCOL_MASK)) return(0); // not a new BL!
if(!(Motor[motor-1].State & MOTOR_STATE_PRESENT_MASK)) return(0); // motor does not exist!
if(!(Motor[motor-1].Version & MOTOR_STATE_NEW_PROTOCOL_MASK)) return(0); // not a new BL!
while(!(BLFlags & BLFLAG_TX_COMPLETE)); //wait for complete transfer
// prepare the bitmask
BLConfig_ReadMask = 0x0001<<(motor-1);
438,6 → 440,8
}
}
motor_read = 0;
BLConfig.Revision = 0; // bad revision
BLConfig.crc = 0; // bad checksum
// needs at least MAX_MOTORS loops of 2 ms (12*2ms = 24ms)
do
{
/beta/Code Redesign killagreg/uart0.c
605,10 → 605,7
break;
 
case 'u': // request BL parameter
tempchar1 = pRxData[0];
Debug("Reading BL %d", tempchar1);
BLConfig.Revision = 0; // bad revision
BLConfig.crc = 0; // bad checksum
Debug("Reading BL %d", pRxData[0]);
// try to read BL configuration
tempchar1 = I2C_ReadBLConfig(pRxData[0]);
if(tempchar1)