[Taranis] A lot of new features, >100 hours work in one commit...

This commit is contained in:
bsongis
2013-11-30 11:11:14 +01:00
committed by Andre Bernet
parent 89c6bb2513
commit 4b9270182e
66 changed files with 3611 additions and 1295 deletions
+2 -1
View File
@@ -160,7 +160,8 @@ void sdPoll10ms();
#endif
// Keys driver
#define KEYS_PRESSED() (~PINL) // used only for DBLKEYS code.
#define TRIMS_PRESSED() (~PINJ)
#define KEYS_PRESSED() (~PINL) // used only for DBLKEYS code.
#define DBLKEYS_PRESSED_RGT_LFT(i) ((in & ((1<<INP_L_KEY_RGT) + (1<<INP_L_KEY_LFT))) == ((1<<INP_L_KEY_RGT) + (1<<INP_L_KEY_LFT)))
#define DBLKEYS_PRESSED_UP_DWN(i) ((in & ((1<<INP_L_KEY_UP) + (1<<INP_L_KEY_DWN))) == ((1<<INP_L_KEY_UP) + (1<<INP_L_KEY_DWN)))
#define DBLKEYS_PRESSED_RGT_UP(i) ((in & ((1<<INP_L_KEY_RGT) + (1<<INP_L_KEY_UP))) == ((1<<INP_L_KEY_RGT) + (1<<INP_L_KEY_UP)))
+2 -1
View File
@@ -163,7 +163,8 @@ void sdPoll10ms();
#endif
// Keys driver
#define KEYS_PRESSED() (~PINL) // used only for DBLKEYS code
#define TRIMS_PRESSED() (~PINJ)
#define KEYS_PRESSED() (~PINL) // used only for DBLKEYS code.
#define DBLKEYS_PRESSED_RGT_LFT(i) ((in & ((1<<INP_L_KEY_RGT) + (1<<INP_L_KEY_LFT))) == ((1<<INP_L_KEY_RGT) + (1<<INP_L_KEY_LFT)))
#define DBLKEYS_PRESSED_UP_DWN(i) ((in & ((1<<INP_L_KEY_UP) + (1<<INP_L_KEY_DWN))) == ((1<<INP_L_KEY_UP) + (1<<INP_L_KEY_DWN)))
#define DBLKEYS_PRESSED_RGT_UP(i) ((in & ((1<<INP_L_KEY_RGT) + (1<<INP_L_KEY_UP))) == ((1<<INP_L_KEY_RGT) + (1<<INP_L_KEY_UP)))
+3 -1
View File
@@ -155,7 +155,9 @@ void setSticksGain(uint8_t gains);
// Keys driver
extern uint32_t readKeys();
#define KEYS_PRESSED() (~readKeys())
extern uint32_t readTrims();
#define TRIMS_PRESSED() (readTrims())
#define KEYS_PRESSED() (~readKeys())
#define DBLKEYS_PRESSED_RGT_LFT(i) ((in & (0x20 + 0x40)) == (0x20 + 0x40))
#define DBLKEYS_PRESSED_UP_DWN(i) ((in & (0x10 + 0x08)) == (0x10 + 0x08))
#define DBLKEYS_PRESSED_RGT_UP(i) ((in & (0x20 + 0x10)) == (0x20 + 0x10))
+33 -16
View File
@@ -45,14 +45,18 @@
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
/*----------------------------------------------------------------------------
* Exported variables
*----------------------------------------------------------------------------*/
#undef errno
extern int errno ;
extern int _end ;
extern int errno;
extern int _end;
extern int _estack;
#define RAM_END (unsigned char *)&_estack
/*----------------------------------------------------------------------------
* Exported functions
@@ -61,23 +65,36 @@ extern void _exit( int status ) ;
extern void _kill( int pid, int sig ) ;
extern int _getpid ( void ) ;
extern caddr_t _sbrk ( int incr )
unsigned char *heap = (unsigned char *)&_end;
extern caddr_t _sbrk(int nbytes)
{
static unsigned char *heap = NULL ;
unsigned char *prev_heap ;
if ( heap == NULL )
{
heap = (unsigned char *)&_end ;
}
prev_heap = heap;
heap += incr ;
return (caddr_t) prev_heap ;
if (heap + nbytes < RAM_END-4096) {
unsigned char *prev_heap = heap;
heap += nbytes;
return (caddr_t) prev_heap;
}
else {
errno = ENOMEM;
return ((void*)-1);
}
}
extern int link( char *old, char *nw )
extern int _gettimeofday(void *p1, void *p2)
{
return 0 ;
}
extern int _link( char *old, char *nw )
{
return -1 ;
}
extern int _unlink (const char *path)
{
return -1 ;
}
extern int _open(const char *name, int flags, int mode)
{
return -1 ;
}
+2 -1
View File
@@ -208,7 +208,8 @@ void backlightFade();
#define INP_G_RuddDR 0
// Keys driver
#define KEYS_PRESSED() (~PINB)
#define TRIMS_PRESSED() (~PIND)
#define KEYS_PRESSED() (~PINB)
#define DBLKEYS_PRESSED_RGT_LFT(i) ((in & ((1<<INP_B_KEY_RGT) + (1<<INP_B_KEY_LFT))) == ((1<<INP_B_KEY_RGT) + (1<<INP_B_KEY_LFT)))
#define DBLKEYS_PRESSED_UP_DWN(i) ((in & ((1<<INP_B_KEY_UP) + (1<<INP_B_KEY_DWN))) == ((1<<INP_B_KEY_UP) + (1<<INP_B_KEY_DWN)))
#define DBLKEYS_PRESSED_RGT_UP(i) ((in & ((1<<INP_B_KEY_RGT) + (1<<INP_B_KEY_UP))) == ((1<<INP_B_KEY_RGT) + (1<<INP_B_KEY_UP)))
+1 -1
View File
@@ -34,7 +34,7 @@
*
*/
#include "../opentx.h"
#include "../../opentx.h"
#define PIN_ANALOG 0x0003
#define PIN_PORTA 0x0000
+3 -1
View File
@@ -124,7 +124,9 @@ void stop_trainer_capture();
// Keys driver
void keysInit();
uint32_t readKeys();
#define KEYS_PRESSED() (~readKeys())
uint32_t readTrims();
#define TRIMS_PRESSED() (readTrims())
#define KEYS_PRESSED() (~readKeys())
#define DBLKEYS_PRESSED_RGT_LFT(i) ((in & ((2<<KEY_PLUS) + (2<<KEY_MINUS))) == ((2<<KEY_PLUS) + (2<<KEY_MINUS)))
#define DBLKEYS_PRESSED_UP_DWN(i) ((in & ((2<<KEY_MENU) + (2<<KEY_PAGE))) == ((2<<KEY_MENU) + (2<<KEY_PAGE)))
#define DBLKEYS_PRESSED_RGT_UP(i) ((in & ((2<<KEY_ENTER) + (2<<KEY_MINUS))) == ((2<<KEY_ENTER) + (2<<KEY_MINUS)))
+1 -1
View File
@@ -34,7 +34,7 @@
*
*/
#include "../opentx.h"
#include "../../opentx.h"
void delaysInit(void)
{
+1 -1
View File
@@ -34,7 +34,7 @@
*
*/
#include "../opentx.h"
#include "../../opentx.h"
extern Fifo<512> telemetryFifo;
+2 -3
View File
@@ -32,9 +32,6 @@
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20020000; /* end of 128K SRAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x200; /* required amount of stack */
@@ -144,6 +141,8 @@ SECTIONS
. = ALIGN(4);
} >RAM
PROVIDE ( _estack = ORIGIN(RAM) + LENGTH(RAM) );
/* MEMORY_bank1 section, code must be located here explicitly */
/* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
.memory_b1_text :
+1 -1
View File
@@ -34,7 +34,7 @@
*
*/
#include "../opentx.h"
#include "../../opentx.h"
void uartInit(uint32_t baudrate)
{