Skip to content

Commit

Permalink
Now atmega64 and atmega2561 support
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed May 23, 2014
1 parent 98cb17e commit da1f1c5
Show file tree
Hide file tree
Showing 11 changed files with 13,186 additions and 4,529 deletions.
4,498 changes: 4,498 additions & 0 deletions bin/er9x-128.hex

Large diffs are not rendered by default.

4,552 changes: 4,552 additions & 0 deletions bin/er9x-2561.hex

Large diffs are not rendered by default.

4,073 changes: 4,073 additions & 0 deletions bin/er9x-64.hex

Large diffs are not rendered by default.

4,499 changes: 0 additions & 4,499 deletions bin/er9x.hex

This file was deleted.

4 changes: 4 additions & 0 deletions source/er9x-frsky/compile-128.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rm ../../bin/er9x-128.hex
make clean
make CPU=128 EXT=FRSKY
mv er9x.hex ../../bin/er9x-128.hex
4 changes: 4 additions & 0 deletions source/er9x-frsky/compile-2561.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rm ../../bin/er9x-2561.hex
make clean
make CPU=2561 EXT=FRSKY
mv er9x.hex ../../bin/er9x-2561.hex
4 changes: 4 additions & 0 deletions source/er9x-frsky/compile-64.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
rm ../../bin/er9x-64.hex
make clean
make EXT=FRSKY TEMPLATES=NO
mv er9x.hex ../../bin/er9x-64.hex
2 changes: 0 additions & 2 deletions source/er9x-frsky/compile.bat

This file was deleted.

40 changes: 20 additions & 20 deletions source/er9x-frsky/en.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,26 +410,26 @@
#define AUTOTUNE 15 // autotune the vehicle's roll and pitch gains
#define HYBRID 16 // hybrid - position hold with manual override
*/
#define STR_MAV_FM_0 "STABILIZE "
#define STR_MAV_FM_1 " ACRO "
#define STR_MAV_FM_2 " ALTHOLD "
#define STR_MAV_FM_3 " AUTO "
#define STR_MAV_FM_4 " GUIDED "
#define STR_MAV_FM_5 " LOITER "
#define STR_MAV_FM_6 " RTL "
#define STR_MAV_FM_7 " CIRCLE "
#define STR_MAV_FM_9 " LAND "
#define STR_MAV_FM_10 "OF LOITER "
#define STR_MAV_FM_11 " DRIFT "
#define STR_MAV_FM_13 " SPORT "
#define STR_MAV_FM_14 " FLIP "
#define STR_MAV_FM_15 "AUTOTUNE "
#define STR_MAV_FM_16 " HYBRID "
#define STR_MAV_FM_97 " Unknown "
#define STR_MAV_FM_98 "NO DRIVER "
#define STR_MAV_FM_99 " NO MAV "
#define STR_MAV_ARMED " ARMED "
#define STR_MAV_DISARMED " Disarmed "
#define STR_MAV_FM_0 "STABILIZE"
#define STR_MAV_FM_1 " ACRO "
#define STR_MAV_FM_2 " ALTHOLD "
#define STR_MAV_FM_3 " AUTO "
#define STR_MAV_FM_4 " GUIDED "
#define STR_MAV_FM_5 " LOITER "
#define STR_MAV_FM_6 " RTL "
#define STR_MAV_FM_7 " CIRCLE "
#define STR_MAV_FM_9 " LAND "
#define STR_MAV_FM_10 "OF LOITER"
#define STR_MAV_FM_11 " DRIFT "
#define STR_MAV_FM_13 " SPORT "
#define STR_MAV_FM_14 " FLIP "
#define STR_MAV_FM_15 "AUTOTUNE "
#define STR_MAV_FM_16 " HYBRID "
#define STR_MAV_FM_97 " Unknown "
#define STR_MAV_FM_98 "NO DRIVER"
#define STR_MAV_FM_99 " NO MAV "
#define STR_MAV_ARMED " ARMED "
#define STR_MAV_DISARMED " Disarmed"
#define STR_MAV_GPS "GPS:"
#define STR_MAV_GPS_3DFIX "3D Fix"
#define STR_MAV_GPS_2DFIX "2D Fix"
Expand Down
33 changes: 28 additions & 5 deletions source/er9x-frsky/menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,28 @@ void MState2::check_simple(uint8_t event, uint8_t curr, const MenuFuncP *menuTab
check(event, curr, menuTab, menuTabSize, 0, 0, maxrow);
}

#if !defined(CPUM128) && !defined(CPUM2561)
const int8_t COS[] = { 100,97,87,71,50,26,0,-26,-50,-71,-87,-97,-100,-97,-87,-71,-50,-26,0,26,50,71,87,97,100 };
const int8_t SIN[] = { 0,26,50,71,87,97,100,97,87,71,50,26,0,-26,-50,-71,-87,-97,-100,-97,-87,-71,-50,-26,0 };

uint16_t normalize( int16_t alpha )
{
if ( alpha > 360 ) alpha -= 360;
if ( alpha < 0 ) alpha = 360 + alpha;
alpha /= 15;
return alpha ;
}
int8_t rcos100( int16_t alpha )
{
alpha = normalize( alpha );
return COS[alpha];
}
int8_t rsin100( int16_t alpha )
{
alpha = normalize( alpha );
return SIN[alpha];
}
#endif
//void MState2::check_submenu_simple(uint8_t event, uint8_t maxrow)
//{
// check_simple(event, 0, 0, 0, maxrow);
Expand Down Expand Up @@ -6786,7 +6808,6 @@ const static prog_uint8_t APM xt[4] = {128*1/4+2, 4, 128-4, 128*3/4-2};
lcd_hbar( 65, 57, 49, 6, FrskyHubData[FR_TXRSI_COPY] ) ;
// THROTTLE bar, %
lcd_vbar( 0, 1 * FH, 4, 6 * FH - 1, FrskyHubData[FR_RPM] ) ;
#if defined(CPUM128) || defined(CPUM2561)
uint8_t x0 = 119;
uint8_t y0 = 30;
uint8_t r = 8;
Expand All @@ -6803,16 +6824,18 @@ const static prog_uint8_t APM xt[4] = {128*1/4+2, 4, 128-4, 128*3/4-2};
}
hdg = hdg - hdg_home + 270 ; // use SIMPLE mode
// lcd_outdez( 15 * FW, 3 * FH, hdg ) ;
// if ( hdg > 360 ) hdg -= 360;
// if ( hdg < 0 ) hdg = 360 + hdg;
for (int8_t i = -3; i < r; i++)
{
x = x0 + i * cos ( hdg * PI / 180.0 ); // TODO: sin & cos -> tables for smaller binary
#if defined(CPUM128) || defined(CPUM2561)
x = x0 + i * cos ( hdg * PI / 180.0 );
y = y0 + i * sin ( hdg * PI / 180.0 );
#else
x = x0 + ( i * rcos100 ( hdg ) ) / 100;
y = y0 + ( i * rsin100 ( hdg ) ) / 100;
#endif
lcd_plot(x, y);
}

#endif
}
/* Extra data for Mavlink via FrSky */
else // Custom screen
Expand Down
6 changes: 3 additions & 3 deletions source/er9x-frsky/stamp-er9x.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//Automatically generated file - do not edit
#define DATE_STR "22.05.2014"
#define TIME_STR "01:44:55"
#define SUB_VERS 44
#define DATE_STR "24.05.2014"
#define TIME_STR "02:24:03"
#define SUB_VERS 86
#define SVN_VERS "er9x-mav-r13"
#define MOD_VERS "FRSKY 128 "

0 comments on commit da1f1c5

Please sign in to comment.