Subversion Repositories FlightCtrl

Compare Revisions

Regard whitespace Rev 1648 → Rev 1649

/beta/Code Redesign killagreg/eeprom.c
51,7 → 51,7
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// + Contant Values
// + Constant Values
// + 0-250 -> normale Values
// + 251 -> Poti1
// + 252 -> Poti2
71,6 → 71,7
#include "led.h"
#include "main.h"
#include "fc.h"
#include "twimaster.h"
 
paramset_t ParamSet;
MixerTable_t Mixer;
/beta/Code Redesign killagreg/main.c
246,10 → 246,6
 
I2C_SendBLConfig();
 
//wait for a short time (otherwise the RC channel check won't work below)
timer = SetDelay(500);
while(!CheckDelay(timer));
 
//if(ParamSet.Config0 & CFG0_AIRPRESS_SENSOR)
{
printf("\n\rCalibrating air pressure sensor.");
/beta/Code Redesign killagreg/twimaster.c
71,17 → 71,9
 
MotorData_t Motor[MAX_MOTORS];
 
BLConfig_t BLConfig =
{
MASK_SET_PWM_SCALING|MASK_SET_CURRENT_LIMIT|MASK_SET_TEMP_LIMIT|MASK_SET_CURRENT_SCALING|MASK_SET_BITCONFIG,
255, // MaxPWM
30, // Current Limit in A
99, // Temperature Limit in °C
64, // Current Scaling
0, // BitConfig
};
BLConfig_t BLConfig[MAX_MOTORS];
 
uint8_t *pTxBuff = (uint8_t*)&BLConfig;
uint8_t *pTxBuff = (uint8_t*)&BLConfig[0];
 
#define BL_CONF_SYNC_BYTE '#'
 
123,6 → 115,12
Motor[i].State = 0;
Motor[i].Current = 0;
Motor[i].MaxPWM = 0;
BLConfig[i].SetMask = MASK_SET_PWM_SCALING|MASK_SET_CURRENT_LIMIT|MASK_SET_TEMP_LIMIT|MASK_SET_CURRENT_SCALING|MASK_SET_BITCONFIG;
BLConfig[i].PwmScaling = 255; // MaxPWM
BLConfig[i].CurrentLimit = 30; // Current Limit in A
BLConfig[i].TempLimit = 99; // Temperature Limit in °C
BLConfig[i].CurrentScaling = 64; // Current Scaling
BLConfig[i].BitConfig = 0; // BitConfig
}
 
SREG = sreg;
275,6 → 273,7
{
I2C_WriteByte(BL_CONF_SYNC_BYTE);
crc += BL_CONF_SYNC_BYTE; // update crc
pTxBuff = (uint8_t*)&BLConfig[motor_write]; // select configuration for motor
}
else if(byte_counter >= sizeof(BLConfig_t)+1) // last byte?
{ // send crc byte at the end
438,6 → 437,7
I2CTimeout = 10;
motor_write = 0;
motor_read = 0;
break;
}
}
 
444,9 → 444,9
 
void I2C_SendBLConfig(void)
{
uint8_t i;
unsigned char i;
while(!(BLFlags & BLFLAG_TX_COMPLETE)); //wait for complete transfer
BLFlags |= BLFLAG_SEND_CONFIG; // enable sending of BL config
while(!(BLFlags & BLFLAG_TX_COMPLETE)); //wait for complete transfer
for(i = 0; i < MAX_MOTORS; i++)
{
Motor[i].SetPoint = 0;
/beta/Code Redesign killagreg/twimaster.h
68,7 → 68,7
uint8_t BitConfig; // see defines below
} __attribute__((packed)) BLConfig_t;
 
extern BLConfig_t BLConfig;
extern BLConfig_t BLConfig[MAX_MOTORS];
 
 
extern volatile uint16_t I2CTimeout;