currentValue = READ_REG(REG_DATAMODUL);
- switch (currentValue & MASK_DATAMODUL_MODULATION_TYPE >> 3) // TODO improvement: change 3 to define
- {
+ switch (currentValue & MASK_DATAMODUL_MODULATION_TYPE >> 3) { // TODO improvement: change 3 to define
case DATAMODUL_MODULATION_TYPE_OOK: return OOK;
case DATAMODUL_MODULATION_TYPE_FSK: return FSK;
default: return undefined;
dev_dbg(&spi->dev, "set: mod shaping");
#endif
- if (rf69_get_modulation(spi) == FSK)
- {
+ if (rf69_get_modulation(spi) == FSK) {
switch (modShaping) {
case shapingOff: return WRITE_REG(REG_DATAMODUL, (READ_REG(REG_DATAMODUL) & ~MASK_DATAMODUL_MODULATION_SHAPE) | DATAMODUL_MODULATION_SHAPE_NONE);
case shaping1_0: return WRITE_REG(REG_DATAMODUL, (READ_REG(REG_DATAMODUL) & ~MASK_DATAMODUL_MODULATION_SHAPE) | DATAMODUL_MODULATION_SHAPE_1_0);
default: INVALID_PARAM;
}
}
- else
- {
+ else {
switch (modShaping) {
case shapingOff: return WRITE_REG(REG_DATAMODUL, (READ_REG(REG_DATAMODUL) & ~MASK_DATAMODUL_MODULATION_SHAPE) | DATAMODUL_MODULATION_SHAPE_NONE);
case shapingBR: return WRITE_REG(REG_DATAMODUL, (READ_REG(REG_DATAMODUL) & ~MASK_DATAMODUL_MODULATION_SHAPE) | DATAMODUL_MODULATION_SHAPE_BR);
// check input value
bitRate_min = F_OSC / 8388608; // 8388608 = 2^23;
- if (bitRate < bitRate_min)
- {
+ if (bitRate < bitRate_min) {
dev_dbg(&spi->dev, "setBitRate: illegal input param");
INVALID_PARAM;
}
dev_dbg(&spi->dev, "set: deviation");
#endif
- if (deviation < 600 || deviation > 500000) //TODO: Abhängigkeit von Bitrate beachten!!
- {
+ if (deviation < 600 || deviation > 500000) { //TODO: Abhängigkeit von Bitrate beachten!!
dev_dbg(&spi->dev, "set_deviation: illegal input param");
INVALID_PARAM;
}
lsb = (f_reg&0xff);
// check msb
- if (msb & !FDEVMASB_MASK)
- {
+ if (msb & !FDEVMASB_MASK) {
dev_dbg(&spi->dev, "set_deviation: err in calc of msb");
INVALID_PARAM;
}
// check input value
f_max = div_u64(f_step * 8388608, factor);
- if (frequency > f_max)
- {
+ if (frequency > f_max) {
dev_dbg(&spi->dev, "setFrequency: illegal input param");
INVALID_PARAM;
}
currentValue = READ_REG(REG_LNA);
- switch (currentValue & MASK_LNA_CURRENT_GAIN >> 3) // improvement: change 3 to define
- {
+ switch (currentValue & MASK_LNA_CURRENT_GAIN >> 3) { // improvement: change 3 to define
case LNA_GAIN_AUTO: return automatic;
case LNA_GAIN_MAX: return max;
case LNA_GAIN_MAX_MINUS_6: return maxMinus6;
dev_dbg(&spi->dev, "set: threshold type");
#endif
- switch (thresholdType)
- {
+ switch (thresholdType) {
case fixed: return WRITE_REG(REG_OOKPEAK, ( (READ_REG(REG_OOKPEAK) & ~MASK_OOKPEAK_THRESTYPE) | OOKPEAK_THRESHTYPE_FIXED) );
case peak: return WRITE_REG(REG_OOKPEAK, ( (READ_REG(REG_OOKPEAK) & ~MASK_OOKPEAK_THRESTYPE) | OOKPEAK_THRESHTYPE_PEAK) );
case average: return WRITE_REG(REG_OOKPEAK, ( (READ_REG(REG_OOKPEAK) & ~MASK_OOKPEAK_THRESTYPE) | OOKPEAK_THRESHTYPE_AVERAGE) );
u8 local_buffer[FIFO_SIZE + 1];
int retval;
- if (size > FIFO_SIZE)
- {
+ if (size > FIFO_SIZE) {
#ifdef DEBUG
dev_dbg(&spi->dev, "read fifo: passed in buffer bigger then internal buffer \n");
#endif
char spi_address = REG_FIFO | WRITE_BIT;
u8 local_buffer[FIFO_SIZE + 1];
- if (size > FIFO_SIZE)
- {
+ if (size > FIFO_SIZE) {
#ifdef DEBUG
dev_dbg(&spi->dev, "read fifo: passed in buffer bigger then internal buffer \n");
#endif