From 3b1ac9f5d8bec985c772080ba5333e248b69b0f8 Mon Sep 17 00:00:00 2001 From: bsongis Date: Wed, 5 Mar 2014 11:58:40 +0100 Subject: [PATCH] 4 more files removed --- radio/bootloader/include/debug.h | 25 - radio/bootloader/include/ersky9x.h | 758 ----------------------------- radio/bootloader/include/file.h | 116 ----- radio/bootloader/include/rtc.h | 71 --- 4 files changed, 970 deletions(-) delete mode 100644 radio/bootloader/include/debug.h delete mode 100644 radio/bootloader/include/ersky9x.h delete mode 100644 radio/bootloader/include/file.h delete mode 100644 radio/bootloader/include/rtc.h diff --git a/radio/bootloader/include/debug.h b/radio/bootloader/include/debug.h deleted file mode 100644 index 57fb289cb..000000000 --- a/radio/bootloader/include/debug.h +++ /dev/null @@ -1,25 +0,0 @@ -#include - -#define TRACE_DEBUG(...) { } -#define TRACE_DEBUG_WP(...) { } -#define TRACE_INFO(...) { } -#define TRACE_INFO_WP(...) { } -#define TRACE_WARNING(...) { } -#define TRACE_WARNING_WP(...) { } -#define TRACE_ERROR(...) { } - -extern void handle_serial( void* pdata ) ; -//extern uint32_t read_switch( enum EnumKeys enuk ) ; -extern void txmit( uint8_t c ) ; -//extern void disp_mem( register uint32_t address ) ; -//extern void disp_256( uint32_t address, uint32_t lines ) ; -#ifdef __cplusplus -extern "C" void utxmit( uint8_t c ) ; -extern "C" void up8hex( uint32_t value ) ; -#else -extern void utxmit( uint8_t c ) ; -extern void up8hex( uint32_t value ) ; -#endif - - - diff --git a/radio/bootloader/include/ersky9x.h b/radio/bootloader/include/ersky9x.h deleted file mode 100644 index e0e0b8640..000000000 --- a/radio/bootloader/include/ersky9x.h +++ /dev/null @@ -1,758 +0,0 @@ -/* - * Author - Mike Blandford - * - * Based on er9x by Erez Raviv - * - * Based on th9x -> http://code.google.com/p/th9x/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -// This version for ARM based ERSKY9X board - -#ifndef ersky9x_h -#define ersky9x_h - -#include - -#define FIX_MODE 1 - -#ifdef SIMU -#include "simpgmspace.h" -#else -// Items set to make things compile, will need to be sorted eventually -#define assert(x) -#ifdef PCBSKY -#define wdt_reset() (WDT->WDT_CR = 0xA5000001) -#endif -#ifdef PCBTARANIS -#define wdt_reset() (IWDG->KR = 0x0000AAAAL) -#endif -#endif - -#define VERSION "V0.26" - -#define GVARS 1 - -//#define DATE_STR "xx.xx.2012" -//#define TIME_STR "xx:xx:xx" -//#define SUB_VERS VERSION -//#define SVN_VERS "trunk-rxxx" -//#define MOD_VERS "Normal" - -//#define STR2(s) #s -//#define DEFNUMSTR(s) STR2(s) - -extern const char stamp1[] ; -extern const char stamp2[] ; -extern const char stamp3[] ; -extern const char stamp4[] ; -extern const char stamp5[] ; - -//extern const char *Str_OFF ; -//extern const char *Str_ON ; -//extern const char *Str_Switches ; -//extern const char *Str_Switch_warn ; - -#define CPU_INT int32_t -#define CPU_UINT uint32_t - -#define BITMASK(bit) (1<<(bit)) - -extern const char * const *Language ; -extern const char * const English[] ; -extern const char * const French[] ; -extern const char * const German[] ; -extern const char * const Norwegian[] ; -extern const char * const Swedish[] ; - -#define PSTR(a) Language[a] -#define XPSTR(a) (char *)a - -#define PROGMEM const unsigned char -#define strcpy_P(a,b) strcpy(a,b) -#define strncpy_P(a,b,c) strncpy(a,b,c) -#define pgm_read_byte(p) (*(p)) - - -#ifdef PCBTARANIS - #define NUMBER_ANALOG 9 -#else -#ifdef REVX -#define NUMBER_ANALOG 10 -#define CURRENT_ANALOG 8 -#else - #ifdef REVB - #define NUMBER_ANALOG 9 - #define CURRENT_ANALOG 8 - #else - #define NUMBER_ANALOG 8 - #endif -#endif -#endif - -#define DIM(arr) (sizeof((arr))/sizeof((arr)[0])) - -enum EnumKeys { - KEY_MENU , - KEY_EXIT , - KEY_DOWN , - KEY_UP , - KEY_RIGHT , - KEY_LEFT , - TRM_LH_DWN , - TRM_LH_UP , - TRM_LV_DWN , - TRM_LV_UP , - TRM_RV_DWN , - TRM_RV_UP , - TRM_RH_DWN , - TRM_RH_UP , - BTN_RE, - -#ifdef PCBSKY - //SW_NC , - //SW_ON , - SW_ThrCt , - SW_RuddDR , - SW_ElevDR , - SW_ID0 , - SW_ID1 , - SW_ID2 , - SW_AileDR , - SW_Gear , - SW_Trainer -#endif - -#ifdef PCBTARANIS - SW_SA0, - SW_SA1, - SW_SA2, - SW_SB0, - SW_SB1, - SW_SB2, - SW_SC0, - SW_SC1, - SW_SC2, - SW_SD0, - SW_SD1, - SW_SD2, - SW_SE0, - SW_SE1, - SW_SE2, - SW_SF0, - SW_SF2, - SW_SG0, - SW_SG1, - SW_SG2, - SW_SH0, - SW_SH2 -#endif -}; - -// c17-c24 added for timer mode A display -//#define CURV_STR "\003---x>0x<0|x|f>0f<0|f|c1 c2 c3 c4 c5 c6 c7 c8 c9 c10c11c12c13c14c15c16c17c18c19c20c21c22c23c24" -#define CURVE_BASE 7 - -//#define CSWITCH_STR "---- v>ofs vofs|v|v2 ""v1=v2 ""v1<=v2 TimeOff" -#define CSW_LEN_FUNC 7 - - -#define CS_OFF 0 -#define CS_VPOS 1 //v>offset -#define CS_VNEG 2 //voffset -#define CS_ANEG 4 //|v| inline t min(t a, t b){ return a inline t max(t a, t b){ return a>b?a:b; } -template inline t limit(t mi, t x, t ma){ return min(max(mi,x),ma); } - -// This doesn't need protection on this processor -#define get_tmr10ms() g_tmr10ms - -#define sysFLAG_OLD_EEPROM (0x01) -extern uint8_t sysFlags; -extern uint8_t StickScrollAllowed ; - -const char s_charTab[]=" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-."; -#define NUMCHARS (sizeof(s_charTab)-1) - -///number of real input channels (1-9) plus virtual input channels X1-X4 -#define PPM_BASE MIX_CYC3 -#define CHOUT_BASE (PPM_BASE+NUM_PPM) - -//extern const char *Str_telemItems ; -extern const int8_t TelemIndex[] ; -extern int16_t convertTelemConstant( int8_t channel, int8_t value) ; -#define NUM_TELEM_ITEMS 35 - -#define NUM_XCHNRAW (CHOUT_BASE+NUM_CHNOUT) // NUMCH + P1P2P3+ AIL/RUD/ELE/THR + MAX/FULL + CYC1/CYC2/CYC3 -#define NUM_SKYXCHNRAW (CHOUT_BASE+NUM_SKYCHNOUT) // NUMCH + P1P2P3+ AIL/RUD/ELE/THR + MAX/FULL + CYC1/CYC2/CYC3 -///number of real output channels (CH1-CH8) plus virtual output channels X1-X4 -#define NUM_XCHNOUT (NUM_CHNOUT) //(NUM_CHNOUT)//+NUM_VIRT) -#define NUM_SKYXCHNOUT (NUM_SKYCHNOUT) //(NUM_CHNOUT)//+NUM_VIRT) - -#define MIX_3POS (NUM_SKYXCHNRAW+1) - -inline int32_t calc100toRESX(register int8_t x) -{ - return ((uint32_t)x*655)>>6 ; -} - -inline int16_t calc1000toRESX( register int32_t x) // improve calc time by Pat MacKenzie -{ - register int32_t y = x>>5; - x+=y; - y=y>>2; - x-=y; - return x+(y>>2); - // return x + x/32 - x/128 + x/512; -} - -extern uint32_t Current_used ; -extern uint16_t Current_max ; -extern uint16_t MAh_used ; -extern uint16_t Run_time ; - -#ifdef FIX_MODE -extern const char stickScramble[] ; -//extern const char modeFix[] ; -uint8_t modeFixValue( uint8_t value ) ; -#else -extern const char modn12x3[] ; -#endif - -extern const uint8_t bchout_ar[] ; - -//convert from mode 1 to mode g_eeGeneral.stickMode -//NOTICE! => 1..4 -> 1..4 -extern uint8_t convert_mode_helper(uint8_t x) ; - -#define CONVERT_MODE(x) (((x)<=4) ? convert_mode_helper(x) : (x)) -//#define CHANNEL_ORDER(x) (chout_ar[g_eeGeneral.templateSetup*4 + (x)-1]) -#define CHANNEL_ORDER(x) ( ( (bchout_ar[g_eeGeneral.templateSetup] >> (6-(x-1) * 2)) & 3 ) + 1 ) -#define THR_STICK (2-(g_eeGeneral.stickMode&1)) -#define ELE_STICK (1+(g_eeGeneral.stickMode&1)) -#define AIL_STICK ((g_eeGeneral.stickMode&2) ? 0 : 3) -#define RUD_STICK ((g_eeGeneral.stickMode&2) ? 3 : 0) - -#define STORE_MODELVARS_TRIM eeDirty(EE_MODEL|EE_TRIM) -#define STORE_MODELVARS eeDirty(EE_MODEL) -#define STORE_GENERALVARS eeDirty(EE_GENERAL) - -#ifdef PCBSKY -#define BACKLIGHT_ON (PWM->PWM_CH_NUM[0].PWM_CDTY = g_eeGeneral.bright) -#define BACKLIGHT_OFF (PWM->PWM_CH_NUM[0].PWM_CDTY = 100) -#endif - -#ifdef PCBTARANIS -extern void backlight_on( void ) ; -extern void backlight_off( void ) ; -#define BACKLIGHT_ON backlight_on() -#define BACKLIGHT_OFF backlight_off() -#endif - -// Options for mainSequence() -#define NO_MENU 1 -#define MENUS 0 - -extern uint16_t evalChkSum( void ) ; - -struct t_calib -{ - int16_t midVals[8]; - int16_t loVals[8]; - int16_t hiVals[8]; - uint8_t idxState; -} ; - -union t_xmem -{ -// struct MixTab s_mixTab[MAX_MIXERS+NUM_XCHNOUT+1] ; - struct t_calib Cal_data ; -#ifndef CPUARM - char buf[sizeof(g_model.name)+5]; -#endif -//#if defined(CPUM128) || defined(CPUM2561) -// uint8_t file_buffer[256]; -//#else -// uint8_t file_buffer[128]; -//#endif -} ; - -extern union t_xmem Xmem ; - - -typedef void (*MenuFuncP)(uint8_t event); - -typedef struct -{ - unsigned char second; //enter the current time, date, month, and year - unsigned char minute; - unsigned char hour; - unsigned char date; - unsigned char month; - unsigned int year; - } t_time ; - -extern t_time Time ; - -extern bool checkIncDec_Ret;//global helper vars -extern uint8_t s_editMode; //global editmode - -int16_t checkIncDec16(uint8_t event, int16_t i_pval, int16_t i_min, int16_t i_max, uint8_t i_flags); -int8_t checkIncDec(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max, uint8_t i_flags); -int8_t checkIncDec_hm(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max); -int8_t checkIncDec_vm(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max); -int8_t checkIncDec_hg(uint8_t event, int8_t i_val, int8_t i_min, int8_t i_max); - -#define CHECK_INCDEC_H_GENVAR( event, var, min, max) \ - var = checkIncDec_hg(event,var,min,max) - -#define CHECK_INCDEC_H_MODELVAR( event, var, min, max) \ - var = checkIncDec_hm(event,var,min,max) - -#define CHECK_INCDEC_MODELSWITCH(event, var, min, max) \ - var = checkIncDec(event,var,min,max,EE_MODEL|INCDEC_SWITCH) - -#define CHECK_INCDEC_GENERALSWITCH( event, var, min, max) \ - var = checkIncDec(event,var,min,max,EE_GENERAL|INCDEC_SWITCH) - - -extern uint8_t heartbeat ; -extern int16_t g_chans512[NUM_SKYCHNOUT]; -//extern uint8_t eeprom[4096] ; - -uint8_t char2idx(char c); -char idx2char(uint8_t idx); - -//extern volatile uint32_t Timer2_count ; // Modified in interrupt routine -extern volatile uint16_t g_tmr10ms ; -extern volatile uint8_t g_blinkTmr10ms; -extern volatile uint8_t tick10ms ; -extern uint32_t Master_frequency ; - -extern void alert(const char * s, bool defaults=false); -extern void message(const char * s); - -void resetTimer(); - - -//extern uint8_t Timer2_running ; -//extern uint16_t Timer2 ; -//void resetTimer2( void ) ; - -extern void putsTime(uint8_t x,uint8_t y,int16_t tme,uint8_t att,uint8_t att2) ; -extern void putsVolts(uint8_t x,uint8_t y, uint8_t volts, uint8_t att) ; -extern void putsVBat(uint8_t x,uint8_t y,uint8_t att) ; -extern void putsVBat(uint8_t x,uint8_t y,uint8_t att) ; -extern void putsChnRaw(uint8_t x,uint8_t y,uint8_t idx,uint8_t att) ; -extern void putsChn(uint8_t x,uint8_t y,uint8_t idx1,uint8_t att) ; -extern void putsDrSwitches(uint8_t x,uint8_t y,int8_t idx1,uint8_t att) ; //, bool nc) ; -extern void putsTmrMode(uint8_t x, uint8_t y, uint8_t attr, uint8_t timer, uint8_t type ) ; -extern const char *get_switches_string( void ) ; - -extern void interrupt5ms() ; - - -extern int16_t intpol(int16_t x, uint8_t idx); - -extern uint16_t anaIn(uint8_t chan) ; - -extern int8_t phyStick[4] ; -extern int16_t ex_chans[NUM_SKYCHNOUT]; - -extern void modelDefault( uint8_t id ) ; -extern uint8_t VoiceCheckFlag ; - -//void eeWaitComplete( void ) ; -void eeDirty(uint8_t msk); -//void eeCheck(bool immediately=false ) ; -void eeReadAll( void ) ; -//void eeLoadModelName(uint8_t id,char*buf,uint8_t len); -//uint16_t eeFileSize(uint8_t id); -//void eeLoadModel(uint8_t id); -//void eeSaveModel(uint8_t id); -bool eeDuplicateModel(uint8_t id); -//bool eeModelExists(uint8_t id); - -extern char idx2char(uint8_t idx) ; -extern uint8_t char2idx(char c) ; - -extern int16_t g_ppmIns[]; -extern uint8_t ppmInState ; //0=unsync 1..8= wait for value i-1 -extern uint8_t ppmInValid ; - -/// goto given Menu, but substitute current menu in menuStack -extern void chainMenu(MenuFuncP newMenu); -/// goto given Menu, store current menu in menuStack -extern void pushMenu(MenuFuncP newMenu); -///deliver address of last menu which was popped from -extern MenuFuncP lastPopMenu(); -/// return to last menu in menustack -/// if uppermost is set true, thenmenu return to uppermost menu in menustack -void popMenu(bool uppermost=false); - -#define NO_TRAINER 0x01 -#define NO_INPUT 0x02 - -// Timeout, in seconds, stick scroll remains active -#define STICK_SCROLL_TIMEOUT 5 - -extern bool getSwitch(int8_t swtch, bool nc, uint8_t level = 0 ) ; -extern int8_t getMovedSwitch( void ) ; -extern uint8_t g_vbat100mV ; -//extern uint16_t Timer2 ; -extern void doSplash( void ) ; -extern void mainSequence( uint32_t no_menu ) ; -#ifdef FRSKY -extern uint8_t putsTelemValue(uint8_t x, uint8_t y, uint8_t val, uint8_t channel, uint8_t att, uint8_t scale) ; -extern void telem_byte_to_bt( uint8_t data ) ; -extern uint16_t scale_telem_value( uint16_t val, uint8_t channel, uint8_t times2, uint8_t *p_att ) ; -#endif -uint8_t telemItemValid( uint8_t index ) ; - -extern int16_t get_telemetry_value( int8_t channel ) ; - -extern void putVoiceQueue( uint16_t value ) ; -void voice_numeric( int16_t value, uint8_t num_decimals, uint8_t units_index ) ; -extern void voice_telem_item( int8_t index ) ; -extern uint8_t *cpystr( uint8_t *dest, uint8_t *source ) ; -extern int16_t m_to_ft( int16_t metres ) ; - -uint8_t getCurrentSwitchStates( void ) ; - -extern uint32_t check_soft_power( void ) ; -extern uint32_t getFlightPhase( void ) ; -extern int16_t getRawTrimValue( uint8_t phase, uint8_t idx ) ; -extern int16_t getTrimValue( uint8_t phase, uint8_t idx ) ; -extern void setTrimValue(uint8_t phase, uint8_t idx, int16_t trim) ; - -extern void checkSwitches( void ) ; -extern void setLanguage( void ) ; - -struct t_timer -{ - uint16_t s_sum ; - uint8_t lastSwPos ; - uint8_t sw_toggled ; - uint16_t s_timeCumSw ; //laufzeit in 1/16 sec - uint8_t s_timerState ; - uint16_t s_timeCumThr ; //gewichtete laufzeit in 1/16 sec - uint16_t s_timeCum16ThrP ; //gewichtete laufzeit in 1/16 sec - int16_t s_timerVal ; -} ; - -extern struct t_timer s_timer[] ; - -// Rotary encoder movement states -#define ROTARY_MENU_LR 0 -#define ROTARY_MENU_UD 1 -#define ROTARY_SUBMENU_LR 2 -#define ROTARY_VALUE 3 - -extern uint8_t RotaryState ; // Defaults to ROTARY_MENU_LR - -#if GVARS -extern int8_t REG(int8_t x, int8_t min, int8_t max) ; -#endif - -enum PowerState -{ - e_power_on, - e_power_trainer, - e_power_usb, - e_power_off -} ; - -struct t_p1 -{ - int16_t p1val ; - int16_t p1valdiff ; - int16_t p1valprev ; - int16_t p2valprev ; - int16_t p3valprev ; -} ; - -extern struct t_p1 P1values ; - -#ifdef PCBSKY -extern uint16_t ResetReason ; -#endif -#ifdef PCBTARANIS -extern uint32_t ResetReason ; -#endif -extern uint8_t unexpectedShutdown ; -extern uint8_t SdMounted ; - -#ifdef PCBTARANIS -#include "stm32f2xx.h" -#include "rtc.h" -#include "stm32f2xx_rtc.h" -void rtcSetTime( t_time *t ) ; -void rtc_gettime( t_time *t ) ; -void rtcInit( void ) ; -#endif - -extern void setVolume( uint8_t value ) ; -extern uint8_t HoldVolume ; - -#ifdef PCBTARANIS -#define INTERNAL_MODULE 0 -#define EXTERNAL_MODULE 1 -#define TRAINER_MODULE 2 -#endif - -#endif diff --git a/radio/bootloader/include/file.h b/radio/bootloader/include/file.h deleted file mode 100644 index f72d8f47b..000000000 --- a/radio/bootloader/include/file.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Author - Erez Raviv - * - * Based on th9x -> http://code.google.com/p/th9x/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ -#ifndef file_h -#define file_h - -#include -#include - - -extern void init_eeprom( void ) ; - -extern uint32_t ee32_check_finished( void ) ; -extern void ee32StoreGeneral( void ) ; -extern void ee32StoreModel( uint8_t modelNumber, uint8_t trim ) ; -extern bool ee32LoadGeneral( void ) ; -extern void ee32LoadModel(uint8_t id) ; -extern void ee32WaitLoadModel(uint8_t id) ; -extern void ee32_delete_model( uint8_t id ) ; -extern bool ee32ModelExists(uint8_t id) ; -extern void ee32_process( void ) ; -extern bool ee32CopyModel( uint8_t dst, uint8_t src ) ; -extern void ee32SwapModels( uint8_t id1, uint8_t id2 ) ; -extern uint32_t ee32_read_512( uint32_t sector, uint8_t *buffer ) ; - - -struct t_file_entry -{ - uint32_t block_no ; - uint32_t sequence_no ; - uint16_t size ; - uint8_t flags ; -} ; - -extern struct t_file_entry File_system[] ; -//extern unsigned char ModelNames[][sizeof(g_model.name)+1] ; // Allow for general - -//extern EEGeneral g_eeGeneral; -//extern ModelData g_model; - -extern uint8_t Spi_tx_buf[] ; -extern uint8_t Spi_rx_buf[] ; - -/// fileId of general file -//#define FILE_GENERAL 0 -/// convert model number 0..MAX_MODELS-1 int fileId -//#define FILE_MODEL(n) (1+n) -//#define FILE_TMP (1+16) - -//bool EeFsOpen(); -//int8_t EeFsck(); -//void EeFsFormat(); -//uint16_t EeFsGetFree(); -//#define ERR_NONE 0 -//#define ERR_FULL 1 -//#define ERR_TMO 2 -//class EFile -//{ -// uint8_t m_fileId; //index of file in directory = filename -// uint16_t m_pos; //over all filepos -// uint8_t m_currBlk; //current block.id -// uint8_t m_ofs; //offset inside of the current block -// uint8_t m_bRlc; //control byte for run length decoder -// uint8_t m_err; //error reasons -// uint16_t m_stopTime10ms; //maximum point of time for writing -//public: - ///remove contents of given file -// static void rm(uint8_t i_fileId); - - ///swap contents of file1 with them of file2 -// static void swap(uint8_t i_fileId1,uint8_t i_fileId2); - - ///return true if the file with given fileid exists -// static bool exists(uint8_t i_fileId); - - ///open file for reading, no close necessary - ///for writing use writeRlc() or create() -// uint8_t openRd(uint8_t i_fileId); - /// create a new file with given fileId, - /// !!! if this file already exists, then all blocks are reused - /// and all contents will be overwritten. - /// after writing closeTrunc has to be called -// void create(uint8_t i_fileId, uint8_t typ, uint16_t maxTme10ms); - /// close file and truncate the blockchain if to long. -// void closeTrunc(); - - ///open file, write to file and close it. - ///If file existed before, then contents is overwritten. - ///If file was larger before, then unused blocks are freed -// uint16_t writeRlc(uint8_t i_fileId, uint8_t typ,uint8_t*buf,uint16_t i_len, uint8_t maxTme10ms); - -// uint8_t read(uint8_t*buf,uint16_t i_len); -// uint8_t write(uint8_t*buf,uint8_t i_len); - - ///return size of compressed file without block overhead -// uint16_t size(); - ///read from opened file and decode rlc-coded data -// uint16_t readRlc(uint8_t*buf,uint16_t i_len); - ///deliver current errno, this is reset in open -// uint8_t errno(){return m_err;} -//}; - -#endif -/*eof*/ diff --git a/radio/bootloader/include/rtc.h b/radio/bootloader/include/rtc.h deleted file mode 100644 index 42557e411..000000000 --- a/radio/bootloader/include/rtc.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Authors (alphabetical order) - * - Andre Bernet - * - Andreas Weitl - * - Bertrand Songis - * - Bryan J. Rentoul (Gruvin) - * - Cameron Weeks - * - Erez Raviv - * - Gabriel Birkus - * - Jean-Pierre Parisy - * - Karl Szmutny - * - Michael Blandford - * - Michal Hlavinka - * - Pat Mackenzie - * - Philip Moss - * - Rob Thomson - * - Romolo Manfredini - * - Thomas Husterer - * - * opentx is based on code named - * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, - * er9x by Erez Raviv: http://code.google.com/p/er9x/, - * and the original (and ongoing) project by - * Thomas Husterer, th9x: http://code.google.com/p/th9x/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef RTC_H -#define RTC_H - -#include - -typedef long int gtime_t; - -struct gtm -{ - int8_t tm_sec; /* Seconds. [0-60] (1 leap second) */ - int8_t tm_min; /* Minutes. [0-59] */ - int8_t tm_hour; /* Hours. [0-23] */ - int8_t tm_mday; /* Day. [1-31] */ - int8_t tm_mon; /* Month. [0-11] */ - int8_t tm_year; /* Year - 1900. Limited to the year 2115. Oh no! :P */ - int8_t tm_wday; /* Day of week. [0-6] */ - int16_t tm_yday; /* Day of year. [0-365] Needed internally for calculations */ -}; - -extern gtime_t g_rtcTime; -extern uint8_t g_ms100; // global to allow time set function to reset to zero - -void rtcInit(); - -#ifdef __cplusplus -extern "C" { -#endif -void rtcSetTime(struct gtm * tm); -void gettime(struct gtm * tm); -gtime_t gmktime (struct gtm *tm); -#ifdef __cplusplus -} -#endif - -#endif