diff -r Multiwii/Alarms.cpp MultiWii_avrfc/Alarms.cpp 531a532,563 > #if defined(LED_FLASHER_SEQUENCE_NOSIGNAL) && defined(FAILSAFE) > /* do we have a special led sequence for no-signal? */ > if (failsafeCnt >= 2) { > led_flasher_set_sequence(LED_FLASHER_SEQUENCE_NOSIGNAL); > return; > } > #endif > > #if defined(LED_FLASHER_SEQUENCE_LOWBAT1) > /* do we have a special led sequence for battery alarm 1? */ > if (alarmArray[ALRM_FAC_VBAT] == ALRM_LVL_VBAT_INFO) { > led_flasher_set_sequence(LED_FLASHER_SEQUENCE_LOWBAT1); > return; > } > #endif > > #if defined(LED_FLASHER_SEQUENCE_LOWBAT2) > /* do we have a special led sequence for battery alarm 2? */ > if (alarmArray[ALRM_FAC_VBAT] == ALRM_LVL_VBAT_WARN) { > led_flasher_set_sequence(LED_FLASHER_SEQUENCE_LOWBAT2); > return; > } > #endif > > #if defined(LED_FLASHER_SEQUENCE_BATCRIT) > /* do we have a special led sequence for critical battery voltage? */ > if (alarmArray[ALRM_FAC_VBAT] == ALRM_LVL_VBAT_CRIT) { > led_flasher_set_sequence(LED_FLASHER_SEQUENCE_BATCRIT); > return; > } > #endif > diff -r Multiwii/EEPROM.cpp MultiWii_avrfc/EEPROM.cpp 134a135,138 > #ifdef HISKY_RX > conf.data_address[5] = {0}; > conf.data_channels[20] = {0}; > #endif Only in MultiWii_avrfc: HiskyRX.cpp Only in MultiWii_avrfc: HiskyRX.h diff -r Multiwii/MultiWii.cpp MultiWii_avrfc/MultiWii.cpp 27a28 > #include "HiskyRX.h" 695a697,701 > #if defined(HISKY_RX) > for (uint8_t i = 0; i < 5; i++) hisky_rx_data_address[i] = conf.data_address[i]; > for (uint8_t i = 0; i < 20; i++) hisky_rx_data_channels[i] = conf.data_channels[i]; > initHiskyRX(); > #endif 852a859,871 > #if defined(HISKY_RX) > static bool hisky_rx_alive = false; > switch (readHiskyRX()) { > case HISKY_RX_BOUND: > for (uint8_t i = 0; i < 5; i++) conf.data_address[i] = hisky_rx_data_address[i]; > for (uint8_t i = 0; i < 20; i++) conf.data_channels[i] = hisky_rx_data_channels[i]; > writeParams(0); > break; > case HISKY_RX_UPDATED: > hisky_rx_alive = true; > break; > } > #endif 860a880,892 > #if defined(HISKY_RX) > rcData[ROLL] = map(constrain(hisky_rx_values[0], 250, 750), 250, 750, 1000, 2000); > rcData[PITCH] = map(constrain(hisky_rx_values[1], 250, 750), 250, 750, 2000, 1000); > rcData[YAW] = map(constrain(hisky_rx_values[3], 250, 750), 250, 750, 2000, 1000); > rcData[THROTTLE] = map(constrain(hisky_rx_values[2], 250, 750), 250, 750, 2000, 1000); > rcData[AUX1] = map(constrain(hisky_rx_values[6], 250, 750), 250, 750, 1000, 2000); > if (hisky_rx_alive) { > #if defined(FAILSAFE) > if (failsafeCnt > 20) failsafeCnt -= 20; else failsafeCnt = 0; > #endif > hisky_rx_alive = false; > } > #else 861a894 > #endif Only in Multiwii/: MultiWii.ino Only in MultiWii_avrfc: MultiWii_avrfc.ino Only in MultiWii_avrfc: NRF24L01.cpp Only in MultiWii_avrfc: NRF24L01.h diff -r Multiwii/Output.cpp MultiWii_avrfc/Output.cpp 417a418,420 > #if F_CPU == 8000000UL > OCR1A = motor[0]>>1; // pin 9 > #else 418a422 > #endif 430a435,437 > #if F_CPU == 8000000UL > OCR1B = motor[1]>>1; // pin 10 > #else 431a439 > #endif 434c442 < #if (NUMBER_MOTOR > 2) --- > #if (NUMBER_MOTOR > 2) && !defined(QUADX2) 447c455 < #if (NUMBER_MOTOR > 3) --- > #if (NUMBER_MOTOR > 3) && !defined(QUADX2) 462a471,474 > #if F_CPU == 8000000UL > atomicPWM_PIN6_highState = motor[4]>>4; > atomicPWM_PIN5_highState = motor[5]>>4; > #else 464a477 > #endif 468a482,485 > #if F_CPU == 8000000UL > atomicPWM_PIN6_lowState = 127-atomicPWM_PIN6_highState; > atomicPWM_PIN5_lowState = 127-atomicPWM_PIN5_highState; > #else 470a488 > #endif 502a521,523 > #ifdef QUADX2 > if (i == 2 || i == 3) continue; > #endif 649a671,673 > #elif (NUMBER_MOTOR > 0) && (F_CPU == 8000000UL) > TCCR1A |= (1 << WGM11) | (1 << WGM10); > TCCR1B &= ~(1 << CS10); 658c682 < #if (NUMBER_MOTOR > 2) --- > #if (NUMBER_MOTOR > 2) && !defined(QUADX2) 661c685 < #if (NUMBER_MOTOR > 3) --- > #if (NUMBER_MOTOR > 3) && !defined(QUADX2) 1176a1201,1205 > #elif defined( QUADX2 ) > motor[0] = PIDMIX(-1,+1,+1); //REAR_R > motor[1] = PIDMIX(-1,-1,-1); //FRONT_R > motor[4] = PIDMIX(+1,-1,+1); //FRONT_L > motor[5] = PIDMIX(+1,+1,-1); //REAR_L diff -r Multiwii/config.h MultiWii_avrfc/config.h 3a4,31 > #define CELLS 1 > > #define HISKY_RX > #define NRF24L01_PIN_CE A1 > #define NRF24L01_PIN_CS A0 > > //#define AVRFC_BL_ONE > //#define AVRFC_BL_INTANT > //#define AVRFC_BL_EXTANT > #define AVRFC_BL_MINI > > #if defined(AVRFC_BL_ONE) > #define FORCE_ACC_ORIENTATION(X, Y, Z) {imu.accADC[ROLL] = Y; imu.accADC[PITCH] = -X; imu.accADC[YAW] = Z;} > #define FORCE_GYRO_ORIENTATION(X, Y, Z) {imu.gyroADC[ROLL] = X; imu.gyroADC[PITCH] = Y; imu.gyroADC[YAW] = -Z;} > #elif defined(AVRFC_BL_INTANT) > #define MPU6050_ADDRESS 0x69 > #define FORCE_ACC_ORIENTATION(X, Y, Z) {imu.accADC[ROLL] = -Y; imu.accADC[PITCH] = X; imu.accADC[YAW] = Z;} > #define FORCE_GYRO_ORIENTATION(X, Y, Z) {imu.gyroADC[ROLL] = -X; imu.gyroADC[PITCH] = -Y; imu.gyroADC[YAW] = -Z;} > #elif defined(AVRFC_BL_EXTANT) > #define MPU6050_ADDRESS 0x69 > #define FORCE_ACC_ORIENTATION(X, Y, Z) {imu.accADC[ROLL] = -X; imu.accADC[PITCH] = -Y; imu.accADC[YAW] = Z;} > #define FORCE_GYRO_ORIENTATION(X, Y, Z) {imu.gyroADC[ROLL] = Y; imu.gyroADC[PITCH] = -X; imu.gyroADC[YAW] = -Z;} > #elif defined(AVRFC_BL_MINI) > #define MPU6050_ADDRESS 0x69 > #define FORCE_ACC_ORIENTATION(X, Y, Z) {imu.accADC[ROLL] = Y; imu.accADC[PITCH] = -X; imu.accADC[YAW] = Z;} > #define FORCE_GYRO_ORIENTATION(X, Y, Z) {imu.gyroADC[ROLL] = X; imu.gyroADC[PITCH] = Y; imu.gyroADC[YAW] = -Z;} > #endif > 39a68 > #define QUADX2 136c165 < //#define GY_521 // Chinese 6 DOF with MPU6050, LLC --- > #define GY_521 // Chinese 6 DOF with MPU6050, LLC 483,490c512,519 < //#define OVERRIDE_LEDPIN_PINMODE pinMode (A1, OUTPUT); // use A1 instead of d13 < //#define OVERRIDE_LEDPIN_TOGGLE PINC |= 1<<1; // PINB |= 1<<5; //switch LEDPIN state (digital PIN 13) < //#define OVERRIDE_LEDPIN_OFF PORTC &= ~(1<<1); // PORTB &= ~(1<<5); < //#define OVERRIDE_LEDPIN_ON PORTC |= 1<<1; // was PORTB |= (1<<5); < < //#define OVERRIDE_BUZZERPIN_PINMODE pinMode (A2, OUTPUT); // use A2 instead of d8 < //#define OVERRIDE_BUZZERPIN_ON PORTC |= 1<<2 //PORTB |= 1; < //#define OVERRIDE_BUZZERPIN_OFF PORTC &= ~(1<<2); //PORTB &= ~1; --- > #define OVERRIDE_LEDPIN_PINMODE pinMode (A2, OUTPUT); // use A1 instead of d13 > #define OVERRIDE_LEDPIN_TOGGLE PINC |= 1<<2; // PINB |= 1<<5; //switch LEDPIN state (digital PIN 13) > #define OVERRIDE_LEDPIN_OFF PORTC &= ~(1<<2); // PORTB &= ~(1<<5); > #define OVERRIDE_LEDPIN_ON PORTC |= 1<<2; // was PORTB |= (1<<5); > > #define OVERRIDE_BUZZERPIN_PINMODE pinMode (4, OUTPUT); // use A2 instead of d8 > #define OVERRIDE_BUZZERPIN_ON PORTD |= 1<<4 //PORTB |= 1; > #define OVERRIDE_BUZZERPIN_OFF PORTD &= ~(1<<4); //PORTB &= ~1; 500c529 < #define SERIAL0_COM_SPEED 115200 --- > #define SERIAL0_COM_SPEED 38400 598c627 < //#define FAILSAFE // uncomment to activate the failsafe function --- > #define FAILSAFE // uncomment to activate the failsafe function 600,601c629,630 < #define FAILSAFE_OFF_DELAY 200 // Time for Landing before motors stop in 0.1sec. 1 step = 0.1sec - 20sec in example < #define FAILSAFE_THROTTLE (MINTHROTTLE + 200) // (*) Throttle level used for landing - may be relative to MINTHROTTLE - as in this case --- > #define FAILSAFE_OFF_DELAY 50 // Time for Landing before motors stop in 0.1sec. 1 step = 0.1sec - 20sec in example > #define FAILSAFE_THROTTLE (1000) // (*) Throttle level used for landing - may be relative to MINTHROTTLE - as in this case 611,614c640,643 < //#define LED_FLASHER < //#define LED_FLASHER_DDR DDRB < //#define LED_FLASHER_PORT PORTB < //#define LED_FLASHER_BIT PORTB4 --- > #define LED_FLASHER > #define LED_FLASHER_DDR DDRD > #define LED_FLASHER_PORT PORTD > #define LED_FLASHER_BIT PORTD3 616,619c645,652 < //#define LED_FLASHER_SEQUENCE 0b00000000 // leds OFF < //#define LED_FLASHER_SEQUENCE_ARMED 0b00000101 // create double flashes < //#define LED_FLASHER_SEQUENCE_MAX 0b11111111 // full illumination < //#define LED_FLASHER_SEQUENCE_LOW 0b00000000 // no illumination --- > #define LED_FLASHER_SEQUENCE 0b10000000 // leds OFF > #define LED_FLASHER_SEQUENCE_ARMED 0b11111111 // create double flashes > #define LED_FLASHER_SEQUENCE_MAX 0b11111111 // full illumination > #define LED_FLASHER_SEQUENCE_LOW 0b00000000 // no illumination > #define LED_FLASHER_SEQUENCE_LOWBAT1 0b11110000 // used for low bat threshold 1 > #define LED_FLASHER_SEQUENCE_LOWBAT2 0b11001100 // used for low bat threshold 2 > #define LED_FLASHER_SEQUENCE_BATCRIT 0b10101010 // used for critical battery voltage > #define LED_FLASHER_SEQUENCE_NOSIGNAL 0b10100000 // used for no-signal 881c914 < //#define BUZZER --- > #define BUZZER 894,900c927,933 < //#define VBAT // uncomment this line to activate the vbat code < #define VBATSCALE 131 // (*) (**) change this value if readed Battery voltage is different than real voltage < #define VBATNOMINAL 126 // 12,6V full battery nominal voltage - only used for lcd.telemetry < #define VBATLEVEL_WARN1 107 // (*) (**) 10,7V < #define VBATLEVEL_WARN2 99 // (*) (**) 9.9V < #define VBATLEVEL_CRIT 93 // (*) (**) 9.3V - critical condition: if vbat ever goes below this value, permanent alarm is triggered < #define NO_VBAT 16 // Avoid beeping without any battery --- > #define VBAT // uncomment this line to activate the vbat code > #define VBATSCALE 134 // (*) (**) change this value if readed Battery voltage is different than real voltage > #define VBATNOMINAL (42 * CELLS) // (4.2*n)V full battery nominal voltage - only used for lcd.telemetry > #define VBATLEVEL_WARN1 (35 * CELLS) // (*) (**) (3.5*n)V > #define VBATLEVEL_WARN2 (33 * CELLS) // (*) (**) (3.3*n)V > #define VBATLEVEL_CRIT 31 // (*) (**) (3.1*n)V - critical condition: if vbat ever goes below this value, permanent alarm is triggered > #define NO_VBAT (5 * CELLS) // Avoid beeping without any battery 1020c1053 < //#define MOTOR_STOP --- > #define MOTOR_STOP diff -r Multiwii/def.h MultiWii_avrfc/def.h 237c237 < #elif defined(Y6) || defined(HEX6) || defined(HEX6X) || defined(HEX6H) --- > #elif defined(Y6) || defined(HEX6) || defined(HEX6X) || defined(HEX6H) || defined(QUADX2) 1713c1713 < #elif defined(HEX6) --- > #elif defined(HEX6) || defined(QUADX2) 1796c1796 < #if !defined(SERIAL_SUM_PPM) && !defined(SPEKTRUM) && !defined(SBUS) && !defined(SUMD) --- > #if !defined(SERIAL_SUM_PPM) && !defined(SPEKTRUM) && !defined(SBUS) && !defined(SUMD) && !defined(HISKY_RX) diff -r Multiwii/types.h MultiWii_avrfc/types.h 224a225,228 > #ifdef HISKY_RX > uint8_t data_address[5]; > uint8_t data_channels[20]; > #endif