mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 09:45:21 +03:00
mega2560 update
Nearly the end... transmitter is built and works, the first fly is for next we !
This commit is contained in:
parent
286aa677d0
commit
b95b66e69e
8 changed files with 35 additions and 22 deletions
|
@ -60,7 +60,7 @@ void audioQueue::heartbeat()
|
||||||
speakerOff();
|
speakerOff();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if defined(PCBGRUVIN9X)
|
#if defined(CPUM2560)
|
||||||
if (toneFreq) {
|
if (toneFreq) {
|
||||||
OCR0A = (5000 / toneFreq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?).
|
OCR0A = (5000 / toneFreq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?).
|
||||||
speakerOn();
|
speakerOn();
|
||||||
|
@ -86,7 +86,7 @@ void audioQueue::heartbeat()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (tone2TimeLeft > 0) {
|
if (tone2TimeLeft > 0) {
|
||||||
#if defined(PCBGRUVIN9X)
|
#if defined(CPUM2560)
|
||||||
if (tone2Freq) {
|
if (tone2Freq) {
|
||||||
OCR0A = (5000 / tone2Freq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?).
|
OCR0A = (5000 / tone2Freq); // sticking with old values approx 20(abs. min) to 90, 60 being the default tone(?).
|
||||||
speakerOn();
|
speakerOn();
|
||||||
|
|
|
@ -262,7 +262,7 @@ void menuModelFlightModesAll(uint8_t event)
|
||||||
for (uint8_t t=0; t<NUM_STICKS; t++) {
|
for (uint8_t t=0; t<NUM_STICKS; t++) {
|
||||||
putsTrimMode((9+LEN_FLIGHT_MODE_NAME+t)*FW+TRIMS_OFS, y, i, t, 0);
|
putsTrimMode((9+LEN_FLIGHT_MODE_NAME+t)*FW+TRIMS_OFS, y, i, t, 0);
|
||||||
}
|
}
|
||||||
#if defined(PCBGRUVIN9X)
|
#if defined(CPUM2560)
|
||||||
for (uint8_t t=0; t<NUM_ROTARY_ENCODERS; t++) {
|
for (uint8_t t=0; t<NUM_ROTARY_ENCODERS; t++) {
|
||||||
putsRotaryEncoderMode((13+LEN_FLIGHT_MODE_NAME+t)*FW+TRIMS_OFS+ROTARY_ENC_OFS, y, i, t, 0);
|
putsRotaryEncoderMode((13+LEN_FLIGHT_MODE_NAME+t)*FW+TRIMS_OFS+ROTARY_ENC_OFS, y, i, t, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -514,7 +514,7 @@ void menuMainView(uint8_t event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#if defined(PCBGRUVIN9X) && defined(ROTARY_ENCODERS)
|
#if defined(PCBMEGA2560) && defined(ROTARY_ENCODERS)
|
||||||
for (uint8_t i=0; i<NUM_ROTARY_ENCODERS; i++) {
|
for (uint8_t i=0; i<NUM_ROTARY_ENCODERS; i++) {
|
||||||
int16_t val = getRotaryEncoder(i);
|
int16_t val = getRotaryEncoder(i);
|
||||||
int8_t len = limit((int16_t)0, (int16_t)(((val+1024) * BAR_HEIGHT) / 2048), (int16_t)BAR_HEIGHT);
|
int8_t len = limit((int16_t)0, (int16_t)(((val+1024) * BAR_HEIGHT) / 2048), (int16_t)BAR_HEIGHT);
|
||||||
|
@ -536,7 +536,7 @@ void menuMainView(uint8_t event)
|
||||||
lcd_vline(x-1, VSWITCH_Y-len, len);
|
lcd_vline(x-1, VSWITCH_Y-len, len);
|
||||||
lcd_vline(x, VSWITCH_Y-len, len);
|
lcd_vline(x, VSWITCH_Y-len, len);
|
||||||
}
|
}
|
||||||
#elif defined(PCBGRUVIN9X)
|
#elif defined(CPUM2560)
|
||||||
for (uint8_t i=0; i<NUM_LOGICAL_SWITCH; i++)
|
for (uint8_t i=0; i<NUM_LOGICAL_SWITCH; i++)
|
||||||
putsSwitches(2*FW-3 + (i/3)*(i/3>2 ? 3*FW+2 : (3*FW-1)) + (i/3>2 ? 2*FW : 0), 4*FH+1 + (i%3)*FH, SWSRC_SW1+i, getSwitch(SWSRC_SW1+i) ? INVERS : 0);
|
putsSwitches(2*FW-3 + (i/3)*(i/3>2 ? 3*FW+2 : (3*FW-1)) + (i/3>2 ? 2*FW : 0), 4*FH+1 + (i%3)*FH, SWSRC_SW1+i, getSwitch(SWSRC_SW1+i) ? INVERS : 0);
|
||||||
#elif !defined(PCBSTD)
|
#elif !defined(PCBSTD)
|
||||||
|
|
|
@ -1000,7 +1000,7 @@ uint8_t flightModeTransitionLast = 255;
|
||||||
|
|
||||||
void evalMixes(uint8_t tick10ms)
|
void evalMixes(uint8_t tick10ms)
|
||||||
{
|
{
|
||||||
#if defined(PCBGRUVIN9X) && defined(DEBUG) && !defined(VOICE)
|
#if defined(PCBMEGA2560) && defined(DEBUG) && !defined(VOICE)
|
||||||
PORTH |= 0x40; // PORTH:6 LOW->HIGH signals start of mixer interrupt
|
PORTH |= 0x40; // PORTH:6 LOW->HIGH signals start of mixer interrupt
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -29,13 +29,14 @@ LIBS:opto
|
||||||
LIBS:atmel
|
LIBS:atmel
|
||||||
LIBS:contrib
|
LIBS:contrib
|
||||||
LIBS:valves
|
LIBS:valves
|
||||||
|
LIBS:MEGA2560-cache
|
||||||
EELAYER 27 0
|
EELAYER 27 0
|
||||||
EELAYER END
|
EELAYER END
|
||||||
$Descr A4 11693 8268
|
$Descr A4 11693 8268
|
||||||
encoding utf-8
|
encoding utf-8
|
||||||
Sheet 1 1
|
Sheet 1 1
|
||||||
Title "OpenTX board based on Arduino MEGA2560"
|
Title "OpenTX board based on Arduino MEGA2560"
|
||||||
Date "28 dec 2014"
|
Date "3 jan 2015"
|
||||||
Rev "0"
|
Rev "0"
|
||||||
Comp "Copyright 2015 F. Aguerre"
|
Comp "Copyright 2015 F. Aguerre"
|
||||||
Comment1 ""
|
Comment1 ""
|
||||||
|
@ -46,7 +47,7 @@ $EndDescr
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
9050 2900 8050 2900
|
9050 2900 8050 2900
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
9050 2700 8050 2700
|
8050 2700 9050 2700
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
8100 5250 7800 5250
|
8100 5250 7800 5250
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
|
@ -127,7 +128,7 @@ Wire Notes Line
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
10750 2400 10750 2250
|
10750 2400 10750 2250
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
7600 1400 7600 1500
|
8100 1400 8100 1500
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
6900 1500 6900 1000
|
6900 1500 6900 1000
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
|
@ -526,7 +527,7 @@ Wire Wire Line
|
||||||
Wire Notes Line
|
Wire Notes Line
|
||||||
8450 4700 8000 4700
|
8450 4700 8000 4700
|
||||||
Wire Wire Line
|
Wire Wire Line
|
||||||
9050 2800 7600 2800
|
7600 2800 9050 2800
|
||||||
$Comp
|
$Comp
|
||||||
L SW_PUSH .
|
L SW_PUSH .
|
||||||
U 1 1 5499AF9B
|
U 1 1 5499AF9B
|
||||||
|
@ -1153,23 +1154,23 @@ $EndComp
|
||||||
$Comp
|
$Comp
|
||||||
L GND #PWR?
|
L GND #PWR?
|
||||||
U 1 1 54992E9C
|
U 1 1 54992E9C
|
||||||
P 7600 1500
|
P 8100 1500
|
||||||
F 0 "#PWR?" H 7600 1500 30 0001 C CNN
|
F 0 "#PWR?" H 8100 1500 30 0001 C CNN
|
||||||
F 1 "GND" H 7600 1430 30 0001 C CNN
|
F 1 "GND" H 8100 1430 30 0001 C CNN
|
||||||
F 2 "" H 7600 1500 60 0001 C CNN
|
F 2 "" H 8100 1500 60 0001 C CNN
|
||||||
F 3 "" H 7600 1500 60 0001 C CNN
|
F 3 "" H 8100 1500 60 0001 C CNN
|
||||||
1 7600 1500
|
1 8100 1500
|
||||||
1 0 0 -1
|
1 0 0 -1
|
||||||
$EndComp
|
$EndComp
|
||||||
$Comp
|
$Comp
|
||||||
L C C1
|
L C C1
|
||||||
U 1 1 54992E49
|
U 1 1 54992E49
|
||||||
P 7600 1200
|
P 8100 1200
|
||||||
F 0 "C1" V 7550 1050 50 0000 L CNN
|
F 0 "C1" V 8050 1050 50 0000 L CNN
|
||||||
F 1 "100n" V 7650 1050 50 0000 L CNN
|
F 1 "100n" V 8150 1050 50 0000 L CNN
|
||||||
F 2 "" H 7600 1200 60 0001 C CNN
|
F 2 "" H 8100 1200 60 0001 C CNN
|
||||||
F 3 "" H 7600 1200 60 0001 C CNN
|
F 3 "" H 8100 1200 60 0001 C CNN
|
||||||
1 7600 1200
|
1 8100 1200
|
||||||
1 0 0 -1
|
1 0 0 -1
|
||||||
$EndComp
|
$EndComp
|
||||||
$Comp
|
$Comp
|
||||||
|
@ -41571,4 +41572,16 @@ F 3 "" H 10450 3850 60 0001 C CNN
|
||||||
1 10450 3850
|
1 10450 3850
|
||||||
-1 0 0 -1
|
-1 0 0 -1
|
||||||
$EndComp
|
$EndComp
|
||||||
|
Wire Wire Line
|
||||||
|
6050 7150 6500 7150
|
||||||
|
Wire Wire Line
|
||||||
|
5100 7150 5250 7150
|
||||||
|
Text Label 6500 7150 2 42 ~ 0
|
||||||
|
OpenTX I/O
|
||||||
|
Text GLabel 5250 7150 2 42 Output ~ 0
|
||||||
|
port pin (initial state)
|
||||||
|
Text Notes 5500 7050 0 60 ~ 0
|
||||||
|
Caption
|
||||||
|
Text Label 5550 2550 2 42 ~ 0
|
||||||
|
Gain = 1 + R3/R6
|
||||||
$EndSCHEMATC
|
$EndSCHEMATC
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue