Compare commits

...

73 Commits

Author SHA1 Message Date
romolo.manfredini@gmail.com 938313f027 release 2489 2013-06-18 05:15:39 +00:00
bsongis@gmail.com 10049de852 [Taranis / sky9x] Specific volume for beeps/wav/vario/background
[Taranis] New alarm when TELEMETRY lost/back
2013-06-17 17:21:36 +00:00
bernet.andre@gmail.com 24ee0f03e9 French translations 2013-06-17 11:17:50 +00:00
kjell.kernen@gmail.com bc8cfe5a04 Added a missing end clause in a piece of dead code since it made lupdate produce annoying messages. 2013-06-17 06:42:31 +00:00
kjell.kernen@gmail.com b66577deb5 Finetuning of Swedish translation after simulator tests. 2013-06-16 22:40:22 +00:00
bsongis@gmail.com aff9a411b9 [Taranis] Typo in logs 2013-06-16 19:26:48 +00:00
bernet.andre@gmail.com fd042add99 French extra fonts 2013-06-16 12:59:19 +00:00
bsongis@gmail.com 7d452e798b [Taranis] 32k EEPROM Massstorage FAT (thanks Mike!) 2013-06-16 11:55:10 +00:00
bsongis@gmail.com f79e2aba4f [sky9x/Taranis] Audio mixer! 2013-06-15 16:18:08 +00:00
bsongis@gmail.com 46ae2e434a [stock] Overlap in Custom Functions screen when GRAPHICS=NO 2013-06-12 05:34:35 +00:00
josemoreno259@gmail.com 4c01fa5ccd Eliminada la letra "Ñ" por problemas tecnicos con Companion9x 2013-06-11 22:51:39 +00:00
gbirkus@gmail.com 8270bdabdb haptic queue issue 2013-06-11 20:54:35 +00:00
bsongis@gmail.com 7ec7428da8 [stock] Audio sounds fixed! 2013-06-11 18:14:26 +00:00
bsongis@gmail.com 9016e8dc79 [stock] DBLSIZE char ':' fixed 2013-06-11 18:05:23 +00:00
bsongis@gmail.com 2ec67683ec [stock] Another simplification for DBLSIZE. Thanks Mike for the idea! 2013-06-11 16:33:00 +00:00
kjell.kernen@gmail.com a6c9883383 The Makefile was committed twice by misstake and my merge didn't work... fixed 2013-06-11 12:01:00 +00:00
kjell.kernen@gmail.com 1c695a05d7 Replaced all xbm font files with png versions. The reason is poor tool support for xbm files. 2013-06-11 11:57:06 +00:00
kjell.kernen@gmail.com f4d3759e8a Replaced all xbm font files with png versions. The reason is poor tool support for xbm files. 2013-06-11 11:53:21 +00:00
bsongis@gmail.com cbe3a02fb9 [all] A few other fixes with DBLSIZE font. We will decide which letters are really needed here. I am not sure that the , is needed! 2013-06-11 10:35:54 +00:00
bsongis@gmail.com ab37f82825 [all] A few fixes with DBLSIZE font. We should now use png instead of xbm files. Better supported by Qt! 2013-06-11 09:24:51 +00:00
kjell.kernen@gmail.com 5701c029db Reintroduced ':' character in 10x14 font. Removed dead code in comments. 2013-06-11 09:05:03 +00:00
bsongis@gmail.com 01033837da [stock] The asterisk is always there, no more (!) trick! 2013-06-11 05:48:13 +00:00
bsongis@gmail.com 29b941539b [all] PlaySound has now a repeat argument as PlayTrack
[stock] Flash saving in AUDIO code. Warning, I had to change some VOICE prompt numbers, check the tts.py to know which ones!
[Taranis] DSM2 protocol added when compiling with DSM2=PPM
2013-06-11 05:43:42 +00:00
kjell.kernen@gmail.com 63407597c5 Saved 600 bytes by removing a lot of 10x14 chars and all language specific 10x14 chars. I have left the old code commented out for the decision if Taranis should have full character support or not (no memory problem there). 2013-06-10 21:25:39 +00:00
kjell.kernen@gmail.com c246dc27ce Compressed version of the biggest font that will be used later to save flash in the 9x/9xr 2013-06-10 14:41:07 +00:00
bsongis@gmail.com 62326a67ce [Taranis] Display problem in Mixers screen 2013-06-09 21:42:39 +00:00
kjell.kernen@gmail.com b58dcc9824 Disabled the use of language specific chars (like ÅÄÖüíñ etc) i model names. The reason is that companion can not display them and that they display differently in different languages. Existing models will retain their names, but it is no longer possible to add language specific characters. 2013-06-09 20:00:01 +00:00
bsongis@gmail.com 4b014c163b [Taranis] Mixer screen rearrangement (phases are displayed)
[Taranis] Only 8 chars in Expos/Mixes names (instead of 10)
2013-06-08 19:10:00 +00:00
bsongis@gmail.com f4bdc3888e [all] THR and TH% are zeroed on flight reset 2013-06-08 11:14:15 +00:00
bsongis@gmail.com 86a7429f51 [all] Nasty copy/paste bug on Radio Timer (inactivity alarm raises far too quickly!)
[Taranis] Bad display of selected lines over bitmaps in MODELSEL screen
2013-06-07 15:30:49 +00:00
bsongis@gmail.com fc1349fb75 [all] Nasty copy/paste bug on Radio Timer (inactivity alarm raises far too quickly!)
[Taranis] Bad display of selected lines over bitmaps in MODELSEL screen
2013-06-07 15:29:53 +00:00
kjell.kernen@gmail.com d0c4ddd064 Due to a request from mhotar I have restored the settings for LEN_SPECIAL_CHARS to their original values. 2013-06-07 09:16:58 +00:00
kjell.kernen@gmail.com 6e14b9ee63 All the old font files are removed since they have been copied to another location. 2013-06-06 18:50:01 +00:00
kjell.kernen@gmail.com a861ab1dfd Minor fine tuning of the swedish translation. 2013-06-06 18:48:07 +00:00
kjell.kernen@gmail.com dc36a83cf5 All font files moved to a common directory. This will make skinning easier. 2013-06-06 18:45:52 +00:00
bsongis@gmail.com 855c3b6a6c [all] FAI mode enhancements (RSSI / A1 / A2 allowed), telemetry values also forbidden in custom switches
[all] Expo/DR screen cosmetics.
2013-06-06 16:54:27 +00:00
bsongis@gmail.com 4215d5b55d Compilation error 2013-06-06 05:11:13 +00:00
kjell.kernen@gmail.com cec998133f Checking in temp lbm font files (shudder).It seems that not all developers have the tools to generate them. 2013-06-05 22:32:42 +00:00
romolo.manfredini@gmail.com 718d055cbc Italian custom fonts updated 2013-06-05 22:17:55 +00:00
kjell.kernen@gmail.com e589f91d45 Corrected two faulty font file names in translations.cpp and broken dependencies in Makefile. Standard version now builds again. 2013-06-05 21:38:10 +00:00
kjell.kernen@gmail.com bb3751bb9a Oups I broke the build since I missed dependencies to removed files in the Make file.
This is an untested attempt at bringing the build back up. Hope it works.
2013-06-05 21:24:33 +00:00
kjell.kernen@gmail.com d5f19c0da7 Since a lot more new font files have been added I have changed the naming to directly link to the font sizes. A number of existing files have been renamed and this commit is for the removal of the old copies from the build tree. 2013-06-05 21:12:09 +00:00
bsongis@gmail.com c84501fbd1 [all] Bug introduced in last revision in TELEMETRY screen!
[sky9x] About screen
[all] Expos/DRs screen cosmetics
[all] CSW Timer better range (0.1, 0.5 and 1.0 precision)
2013-06-05 21:11:28 +00:00
kjell.kernen@gmail.com 784bab30b1 Deleting temporary font files that are regenerated automatically. I do not understand why these have been checked into the repository 2013-06-05 21:06:16 +00:00
kjell.kernen@gmail.com b2247dc943 Added stuff so that it is possible to use special characters for all font sizes for all translated langauges. Please note that I have only checked that the small size (4x6) font works in Swedish.Other langauges have empty definition files, which will produce space rather than pointer errors. 2013-06-05 21:00:12 +00:00
kjell.kernen@gmail.com d3704b1c1f Corrected errors in Spanish translation file.
There were no less than three ñ characters in the file.
These have been replaced with \201
2013-06-05 20:40:27 +00:00
romolo.manfredini@gmail.com 46d157f0a4 save some flash space in italian translations 2013-06-05 19:11:16 +00:00
romolo.manfredini@gmail.com 46b46b7c52 Italian translations 2013-06-05 06:35:46 +00:00
romolo.manfredini@gmail.com b2824994aa correct the size of taranis.bin file 2013-06-04 22:04:44 +00:00
bsongis@gmail.com 0ac385eed0 [sky9x] TinyApp and applets removed from the tree
[all] FAI reworked
2013-06-04 16:27:56 +00:00
bsongis@gmail.com cf578bbaa0 [stock] Sink tones on vario removed
[all] Bug in custom switch timers (when using the AND switch)
2013-06-04 09:25:09 +00:00
bsongis@gmail.com 6427b8a8bb Issue 41 fixed 2013-06-03 20:50:00 +00:00
bsongis@gmail.com ffe29e6f1a [stock] Issue 44 fixed (without AUDIO and VOICE)
[all] Issue 3 fixed (Timer function in custom switches)
[stock] Huge flash savings ...
[stock] No more sink in vario
[all] FAI mode (YES/NO/CHOICE)
2013-06-03 19:00:37 +00:00
bernet.andre@gmail.com dd7e9ae2b4 German translations by H.Renz 2013-06-03 14:43:32 +00:00
bsongis@gmail.com 6dc8eb75a2 Issue 45 fixed. Thanks for the report and the fix proposed. This code is used on boards where there is only 1 module. So only s_current_protocol[0] is accessible. 2013-06-02 14:45:53 +00:00
bsongis@gmail.com a8f99b1b61 Issue 43 fixed. Who wants to test? I didn't do it myself! Thanks in advance! 2013-05-31 20:23:06 +00:00
bsongis@gmail.com c9171c6d79 [all] Mixer bugs fixed (slow / delays)
[stock] Flash saving
[stock] PWM backlight fix
[stock] NAVIGATION=STICKS pulled from er9x, thanks Mike!
[Taranis] Telemetry logs in DEBUG mode correctly opened / closed (not tested)
2013-05-31 19:33:20 +00:00
bsongis@gmail.com 7e7b1914ff [stock] Avoids the renumbering of the prompts "30s" and "20s" 2013-05-30 06:10:40 +00:00
bsongis@gmail.com cf3da300b5 Cosmetics 2013-05-30 06:10:24 +00:00
bsongis@gmail.com f7c207547f Cosmetics 2013-05-30 06:10:07 +00:00
bsongis@gmail.com 61b8f4b4e4 [all] RSSI should be 0 when NO DATA 2013-05-29 15:43:21 +00:00
bsongis@gmail.com 3a8220a4bb [Taranis] Failsafe settings hidden when the receiver is a D8 2013-05-29 15:36:09 +00:00
bsongis@gmail.com ad653ecd0f [all] The delays now apply to mixes without a trigger (phase / switch), but with a 3POS switch.
[all] The "bolded mixers" (bolded, and beeping if beep selected) follow these rules:
- when a mix has no trigger, it is always bolded
- when a mix doesn't apply to the current phase, it is not bolded, even during fade out (same for expos)
- when a mix is leaving with slow down, it is not bolded
- when there is a delay applied to a mix, it is bolded according to this delay
[stock] All the changes described above even allowed me to save 68 bytes flash and 38 bytes RAM!

As always when the Mixer is partially rewritten, a lot of tests are needed before the next release!
2013-05-29 05:37:53 +00:00
bsongis@gmail.com b593317360 [Taranis] Failsafe modes NOPULSES and HOLD should be ok on channels 9-16 2013-05-29 05:26:30 +00:00
bsongis@gmail.com 40b42a4171 [Taranis] Failsafe modes NOPULSES and HOLD should be ok on channels 9-16 2013-05-29 05:20:41 +00:00
bsongis@gmail.com 1ee7247576 [Taranis/sky9x/gruvin9x] Some rework on Logs 2013-05-28 19:40:29 +00:00
bsongis@gmail.com 98456f9489 [stock] Compilation error fixed when HAPTIC and !AUDIO 2013-05-27 20:25:12 +00:00
bsongis@gmail.com 3492b5d0a6 Issue 41 fixed
RSSI alarms thresholds now 45 and 42 instead of 50
2013-05-27 17:36:01 +00:00
bsongis@gmail.com 1aff10dc35 [all] Issue 17 fixed (lowercase is now the default)
[all] Issue 28 fixed (10 beeps on countdown during the last 10 seconds)
[all] Issue 37 fixed (Pwr+) added
[all] Issue 39 fixed (Potscroll too slow)
[Taranis] Bug with delays on 3 states switches
[Taranis/sky9x/gruvin9x] Date & Time not always saved
2013-05-26 20:48:26 +00:00
bernet.andre@gmail.com 33fff62c0c Cosmetics 2013-05-26 10:48:08 +00:00
josemoreno259@gmail.com 1042f3ea2e slight changes 2013-05-24 17:43:47 +00:00
bernet.andre@gmail.com 6a3b539a22 Bind/Rangecheck sound for PXX and DSM 2013-05-23 22:48:29 +00:00
bernet.andre@gmail.com edb07e2c56 Bind/Rangecheck sound for PXX and DSM 2013-05-23 22:32:27 +00:00
188 changed files with 2781 additions and 31207 deletions
-206
View File
@@ -1,206 +0,0 @@
/*****************************************************************************/
#define TWI_CMD_PAGEUPDATE 0x01 // TWI Command to program a flash page
#define TWI_CMD_EXECUTEAPP 0x02 // TWI Command to jump to the application program
#define TWI_CMD_SETREAD_ADDRESS 0x03 // TWI Command to set address to read from
#define TWI_CMD_WRITE_DATA 0x04 // TWI Command send data to the application
#define TWI_CMD_REBOOT 0x55 // TWI Command to restart back in the bootloader
#define TWI_SUBCMD_SETDATETIME 0x74 // TWI Command to set the date and time
//#define TWI_CMD_BVERSION 0x04 // TWI Command to get the bootloader revision identifier
//#define TWI_CMD_ERASEFLASH 0x05 // TWI Command to erase the entire application section of flash memory
//#define TWI_CMD_GETERRCONDN 0x07 // TWI Command to get Error condition
/*****************************************************************************/
//#define BOOT_SETTLE_DELAY 100 // Debounce delay for the boot pin in MCU cycles
//#define SLAVE_ADDRESS 0xb0 // The address identifier of this slave device on the TWI (I2C) bus
#define INTVECT_PAGE_ADDRESS 0x000 // The location of the start of the interrupt vector table address
// Select the communcation interfacing type: TWI or USI
/*#if defined(__ATTINY25__) | defined(__ATTINY25V__) | \
defined(__ATTINY45__) | defined(__ATTINY45V__) | \
defined(__ATTINY85__) | defined(__ATTINY85V__) | \
defined(__ATTINY24__) | defined(__ATTINY24A__) | \
defined(__ATTINY44__) | defined(__ATTINY44A__) | \
defined(__ATTINY84__) | defined(__ATTINY84A__) | \
defined(__ATTINY2313__) | defined(__ATTINY2313A__) | \
defined(__ATTINY4313__) | defined(__ATTINY4313A__) | \
defined(__ATTINY261__) | defined(__ATTINY261A__) | \
defined(__ATTINY461__) | defined(__ATTINY461A__) | \
defined(__ATTINY861__) | defined(__ATTINY861A__) | \
defined(__ATTINY43U__) | \
defined(__ATTINY87__) | \
defined(__ATTINY167__)
#define __USI__ // set the communication type as USI
#endif */
#define __USI__ // set the communication type as USI
/*#if defined(__ATTINY48__) | defined(__ATTINY88__) | \
defined(__ATMEGA48A__) | defined(__ATMEGA48PA__) | \
defined(__ATMEGA48__)
#define __TWI__
#endif */
/***************************************************************/
// Page size selection for the controller with 2K flash
/*#if defined(__ATTINY25__) | defined(__ATTINY25V__) | \
defined(__ATTINY24__) | defined(__ATTINY24A__) | \
defined(__ATTINY2313__) | defined(__ATTINY2313A__) | \
defined(__ATTINY261__) | defined(__ATTINY261A__)
// The flash memory page size for these devices
#define PAGE_SIZE 32
// Page 32, the start of bootloader section
#define BOOT_PAGE_ADDRESS 0X0400
// 2KB of flash divided by pages of size 32 bytes
#define TOTAL_NO_OF_PAGES 64
// The number of pages being used for bootloader code
#define BOOTLOADER_PAGES (TOTAL_NO_OF_PAGES - BOOT_PAGE_ADDRESS/PAGE_SIZE)
// For bounds check during page write/erase operation to protect the bootloader code from being corrupted
#define LAST_PAGE_NO_TO_BE_ERASED (TOTAL_NO_OF_PAGES - BOOTLOADER_PAGES)
#endif */
// Page size selection for the controller with 4K flash
/*#if defined(__ATTINY45__) | defined(__ATTINY45V__) | \
defined(__ATTINY44__) | defined(__ATTINY44A__) | \
defined(__ATTINY4313__) | defined(__ATTINY4313A__) | \
defined(__ATTINY461__) | defined(__ATTINY461A__) | \
defined(__ATTINY43U__) | \
defined(__ATTINY48__) | \
defined(__ATMEGA48__) | \
defined(__ATMEGA48A__) | defined(__ATMEGA48PA__)
// The flash memory page size for these devices
#define PAGE_SIZE 64
// Page 48, the start of bootloader section
#define BOOT_PAGE_ADDRESS 0X0C00
// 4KB of flash divided by pages of size 64 bytes
#define TOTAL_NO_OF_PAGES 64
// The number of pages being used for bootloader code
#define BOOTLOADER_PAGES (TOTAL_NO_OF_PAGES - BOOT_PAGE_ADDRESS/PAGE_SIZE)
// For bounds check during page write/erase operation to protect the bootloader code from being corrupted
#define LAST_PAGE_NO_TO_BE_ERASED (TOTAL_NO_OF_PAGES - BOOTLOADER_PAGES)
#endif */
// Page size selection for the controller with 8K flash
/*#if defined(__ATTINY85__) | defined(__ATTINY85V__) | \
defined(__ATTINY84__) | defined(__ATTINY84A__) | \
defined(__ATTINY861__) | defined(__ATTINY861A__) | \
defined(__ATTINY87__) | \
defined(__ATTINY88__)
// The flash memory page size for these devices
#define PAGE_SIZE 64
// Page 112, the start of bootloader section
#define BOOT_PAGE_ADDRESS 0X1C00
// 8KB of flash divided by pages of size 64 bytes
#define TOTAL_NO_OF_PAGES 128
// The number of pages being used for bootloader code
#define BOOTLOADER_PAGES (TOTAL_NO_OF_PAGES - BOOT_PAGE_ADDRESS/PAGE_SIZE)
// // For bounds check during page write/erase operation to protect the bootloader code from being corrupted
// #define LAST_PAGE_NO_TO_BE_ERASED (TOTAL_NO_OF_PAGES - BOOTLOADER_PAGES)
//#endif*/
// Page size selection for the controller with 16K flash
//#if defined(__ATTINY167__)
// The flash memory page size for Atiny167
#define PAGE_SIZE 128
// Page 120, the start of bootloader section
#define BOOT_PAGE_ADDRESS 0X3800
// 16KB of flash divided by pages of size 128 bytes
#define TOTAL_NO_OF_PAGES 128
// The number of pages being used for bootloader code
#define BOOTLOADER_PAGES (TOTAL_NO_OF_PAGES - BOOT_PAGE_ADDRESS/PAGE_SIZE)
// For bounds check during page write/erase operation to protect the bootloader code from being corrupted
#define LAST_PAGE_NO_TO_BE_ERASED (TOTAL_NO_OF_PAGES - BOOTLOADER_PAGES)
//#endif
/*****************************************************************************/
/*****************************************************************************/
// Select the correct Bit name of to SELFPROGRAMming
/*#if defined(__ATTINY48__) | defined(__ATTINY48A__) | \
defined(__ATTINY88__) | defined(__ATTINY88A__) | \
defined(__ATMEGA48__) | \
defined(__ATMEGA48A__) | defined(__ATMEGA48PA__)
#define SELFPROGEN SELFPRGEN
#endif */
/*****************************************************************************/
/*****************************************************************************/
/*#if defined(__ATTINY25__) | defined(__ATTINY25V__) | \
defined(__ATTINY45__) | defined(__ATTINY45V__) | \
defined(__ATTINY85__) | defined(__ATTINY85V__) | \
defined(__ATTINY87__) | defined(__ATTINY167__) */
#define SELFPROGEN SPMEN
//#endif
/*****************************************************************************/
/*****************************************************************************/
#define WDT_TIMEOUT_8s ( _BV( WDP3 ) | _BV( WDP0 ) ) // Watchdog timeout for inactivity in the boot section
#define WDT_TIMEOUT_16ms 0 // Watchdog timeout for system reset (cleanup) before jump to application
#define WDT_TIMEOUT_min WDT_TIMEOUT_16ms // The minimum watchdog reset time interval for jump to application
/*****************************************************************************/
/*****************************************************************************/
#define STATUSMASK_SPMBUSY 0x01 // The mask bit for SPM busy status code
#define STATUSMASK_BLSCERR 0x02 // The mask bit for attempt to override bootloader section
#define STATUSMASK_TWIABORT 0x04 // The mask bit for indicating TWI abort fn called
#define STATUSMASK_SLTR_BUSY 0x08 // The mask bit for slave transmit
#define STATUSMASK_SLRBAA_BUSY 0x10 // The mask bit for slave receive and ack
#define STATUSMASK_SLRBAN_BUSY 0x20 // The mask bit for slave receive and Nack
#define STATUSMASK_EEPROM_BUSY 0x40 // The mask bit for EEPROM busy
#define STATUSMASK_BOOTLOADER 0x80 // The mask bit for bootloader operations
/*****************************************************************************/
/*****************************************************************************/
#define EEMEM_ADDR_AVERSION 0x05 // The address in EEPROM where application revision identifier will be stored
#define BVERSION 0x96 // This bootloader revision identifier
//static void UpdatePage (uint16_t);
#ifndef _BV
#define _BV( __BIT_POSITION__ ) ( 1 << __BIT_POSITION__ )
#endif
//#ifdef _BV
//#warning _BV now stands defined
//#endif
-624
View File
@@ -1,624 +0,0 @@
# Hey Emacs, this is a -*- makefile -*-
#----------------------------------------------------------------------------
# WinAVR Makefile
#
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device, using avrdude.
# Please customize the avrdude settings below first!
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------
# MCU name
MCU = attiny167
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
# Typical values are:
# F_CPU = 1000000
# F_CPU = 1843200
# F_CPU = 2000000
# F_CPU = 3686400
# F_CPU = 4000000
# F_CPU = 7372800
# F_CPU = 8000000
# F_CPU = 11059200
# F_CPU = 14745600
# F_CPU = 16000000
# F_CPU = 18432000
# F_CPU = 20000000
F_CPU = 8000000
# Output format. (can be srec, ihex, binary)
FORMAT = ihex
# Target file name (without extension).
TARGET = TinyApp
# Object files directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
OBJDIR = .
# List C source files here. (C dependencies are automatically generated.)
SRC = $(TARGET).c
# List C++ source files here. (C dependencies are automatically generated.)
CPPSRC =
# List Assembler source files here.
# Make them always end in a capital .S. Files ending in a lowercase .s
# will not be considered source files but generated files (assembler
# output from the compiler), and will be deleted upon "make clean"!
# Even though the DOS/Win* filesystem matches both .s and .S the same,
# it will preserve the spelling of the filenames, and gcc itself does
# care about how the name is spelled on its command-line.
ASRC =
# Optimization level, can be [0, 1, 2, 3, s].
# 0 = turn off optimization. s = optimize for size.
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s
# Debugging format.
# Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
# AVR Studio 4.10 requires dwarf-2.
# AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
#DEBUG = stabs
DEBUG = dwarf-2
# List any extra directories to look for include files here.
# Each directory must be seperated by a space.
# Use forward slashes for directory separators.
# For a directory that has spaces, enclose it in quotes.
EXTRAINCDIRS = c:\progs\iccv7avr\include
# Compiler flag to set the C Standard level.
# c89 = "ANSI" C
# gnu89 = c89 plus GCC extensions
# c99 = ISO C99 standard (not yet fully implemented)
# gnu99 = c99 plus GCC extensions
CSTANDARD = -std=gnu99
# Place -D or -U options here for C sources
CDEFS = -DF_CPU=$(F_CPU)UL
# Place -D or -U options here for ASM sources
ADEFS = -DF_CPU=$(F_CPU)
# Place -D or -U options here for C++ sources
CPPDEFS = -DF_CPU=$(F_CPU)UL
#CPPDEFS += -D__STDC_LIMIT_MACROS
#CPPDEFS += -D__STDC_CONSTANT_MACROS
#---------------- Compiler Options C ----------------
# -g*: generate debugging information
# -O*: optimization level
# -f...: tuning, see GCC manual and avr-libc documentation
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
CFLAGS = -g$(DEBUG)
CFLAGS += $(CDEFS)
CFLAGS += -O$(OPT)
CFLAGS += -funsigned-char
CFLAGS += -funsigned-bitfields
CFLAGS += -fpack-struct
CFLAGS += -fshort-enums
CFLAGS += -Wall
CFLAGS += -Wno-main
CFLAGS += -Wstrict-prototypes
#CFLAGS += -mshort-calls
#CFLAGS += -fno-unit-at-a-time
#CFLAGS += -Wundef
#CFLAGS += -Wunreachable-code
#CFLAGS += -Wsign-compare
CFLAGS += -Wa,-adlns=$(<:%.c=$(OBJDIR)/%.lst)
CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
CFLAGS += $(CSTANDARD)
# Next line dumps rtl file
#CFLAGS += -dr
#CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst)
#---------------- Compiler Options C++ ----------------
# -g*: generate debugging information
# -O*: optimization level
# -f...: tuning, see GCC manual and avr-libc documentation
# -Wall...: warning level
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns...: create assembler listing
CPPFLAGS = -g$(DEBUG)
CPPFLAGS += $(CPPDEFS)
CPPFLAGS += -O$(OPT)
CPPFLAGS += -funsigned-char
CPPFLAGS += -funsigned-bitfields
CPPFLAGS += -fpack-struct
CPPFLAGS += -fshort-enums
CPPFLAGS += -fno-exceptions
CPPFLAGS += -Wall
CFLAGS += -Wundef
#CPPFLAGS += -mshort-calls
#CPPFLAGS += -fno-unit-at-a-time
#CPPFLAGS += -Wstrict-prototypes
#CPPFLAGS += -Wunreachable-code
#CPPFLAGS += -Wsign-compare
CPPFLAGS += -Wa,-adlns=$(<:%.cpp=$(OBJDIR)/%.lst)
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
#CPPFLAGS += $(CSTANDARD)
#CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
#---------------- Assembler Options ----------------
# -Wa,...: tell GCC to pass this to the assembler.
# -adhlns: create listing
# -gstabs: have the assembler create line number information; note that
# for use in COFF files, additional information about filenames
# and function names needs to be present in the assembler source
# files -- see avr-libc docs [FIXME: not yet described there]
# -listing-cont-lines: Sets the maximum number of continuation lines of hex
# dump that will be displayed for a given single line of source input.
ASFLAGS = $(ADEFS) -Wa,-adhlns=$(<:%.S=$(OBJDIR)/%.lst),-gstabs,--listing-cont-lines=100
#---------------- Library Options ----------------
# Minimalistic printf version
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
# Floating point printf version (requires MATH_LIB = -lm below)
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
# If this is left blank, then it will use the Standard printf version.
PRINTF_LIB =
#PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
# Minimalistic scanf version
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
# If this is left blank, then it will use the Standard scanf version.
SCANF_LIB =
#SCANF_LIB = $(SCANF_LIB_MIN)
#SCANF_LIB = $(SCANF_LIB_FLOAT)
MATH_LIB = -lm
# List any extra directories to look for libraries here.
# Each directory must be seperated by a space.
# Use forward slashes for directory separators.
# For a directory that has spaces, enclose it in quotes.
EXTRALIBDIRS =
#---------------- External Memory Options ----------------
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
# used for variables (.data/.bss) and heap (malloc()).
#EXTMEMOPTS = -Wl,-Tdata=0x801100,--defsym=__heap_end=0x80ffff
# 64 KB of external RAM, starting after internal RAM (ATmega128!),
# only used for heap (malloc()).
#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff
EXTMEMOPTS =
#---------------- Linker Options ----------------
# -Wl,...: tell GCC to pass this to linker.
# -Map: create map file
# --cref: add cross reference to map file
LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
LDFLAGS += -Wl,--section-start=.text=0x00D0
LDFLAGS += -Wl,--section-start=.vectors=0x0080
LDFLAGS += -T avr3-167.ld
LDFLAGS += -N
#---------------- Programming Options (avrdude) ----------------
# Programming hardware: alf avr910 avrisp bascom bsd
# dt006 pavr picoweb pony-stk200 sp12 stk200 stk500
#
# Type: avrdude -c ?
# to get a full listing.
#
AVRDUDE_PROGRAMMER = stk500
# com1 = serial port. Use lpt1 to connect to parallel port.
AVRDUDE_PORT = com3
AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
# Uncomment the following if you want avrdude's erase cycle counter.
# Note that this counter needs to be initialized first using -Yn,
# see avrdude manual.
#AVRDUDE_ERASE_COUNTER = -y
# Uncomment the following if you do /not/ wish a verification to be
# performed after programming the device.
#AVRDUDE_NO_VERIFY = -V
# Increase verbosity level. Please use this when submitting bug
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
#AVRDUDE_VERBOSE = -v -v
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
#---------------- Debugging Options ----------------
# For simulavr only - target MCU frequency.
DEBUG_MFREQ = $(F_CPU)
# Set the DEBUG_UI to either gdb or insight.
# DEBUG_UI = gdb
DEBUG_UI = insight
# Set the debugging back-end to either avarice, simulavr.
DEBUG_BACKEND = avarice
#DEBUG_BACKEND = simulavr
# GDB Init Filename.
GDBINIT_FILE = __avr_gdbinit
# When using avarice settings for the JTAG
JTAG_DEV = /dev/com1
# Debugging port used to communicate between GDB / avarice / simulavr.
DEBUG_PORT = 4242
# Debugging host used to communicate between GDB / avarice / simulavr, normally
# just set to localhost unless doing some sort of crazy debugging when
# avarice is running on a different computer.
DEBUG_HOST = localhost
#============================================================================
# Define programs and commands.
SHELL = sh
CC = avr-gcc
OBJCOPY = avr-objcopy
OBJDUMP = avr-objdump
SIZE = avr-size
AR = avr-ar rcs
NM = avr-nm
AVRDUDE = avrdude
REMOVE = rm -f
REMOVEDIR = rm -rf
COPY = cp
WINSHELL = cmd
# Define Messages
# English
MSG_ERRORS_NONE = Errors: none
MSG_BEGIN = -------- begin --------
MSG_END = -------- end --------
MSG_SIZE_BEFORE = Size before:
MSG_SIZE_AFTER = Size after:
MSG_COFF = Converting to AVR COFF:
MSG_EXTENDED_COFF = Converting to AVR Extended COFF:
MSG_FLASH = Creating load file for Flash:
MSG_EEPROM = Creating load file for EEPROM:
MSG_EXTENDED_LISTING = Creating Extended Listing:
MSG_SYMBOL_TABLE = Creating Symbol Table:
MSG_LINKING = Linking:
MSG_COMPILING = Compiling C:
MSG_COMPILING_CPP = Compiling C++:
MSG_ASSEMBLING = Assembling:
MSG_CLEANING = Cleaning project:
MSG_CREATING_LIBRARY = Creating library:
# Define all object files.
OBJ = $(SRC:%.c=$(OBJDIR)/%.o) $(CPPSRC:%.cpp=$(OBJDIR)/%.o) $(ASRC:%.S=$(OBJDIR)/%.o)
# Define all listing files.
LST = $(SRC:%.c=$(OBJDIR)/%.lst) $(CPPSRC:%.cpp=$(OBJDIR)/%.lst) $(ASRC:%.S=$(OBJDIR)/%.lst)
# Compiler flags to generate dependency files.
GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d
# Combine all necessary flags and optional flags.
# Add target processor to flags.
ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) $(GENDEPFLAGS)
ALL_CPPFLAGS = -mmcu=$(MCU) -I. -x c++ $(CPPFLAGS) $(GENDEPFLAGS)
ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS)
# Default target.
all: begin gccversion sizebefore build sizeafter end
# Change the build target to build a HEX file or a library.
build: elf hex eep lss sym bin
#build: lib
elf: $(TARGET).elf
hex: $(TARGET).hex
bin: $(TARGET).bin
eep: $(TARGET).eep
lss: $(TARGET).lss
sym: $(TARGET).sym
LIBNAME=lib$(TARGET).a
lib: $(LIBNAME)
# Eye candy.
# AVR Studio 3.x does not check make's exit code but relies on
# the following magic strings to be generated by the compile job.
begin:
@echo
@echo $(MSG_BEGIN)
end:
@echo $(MSG_END)
@echo
# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf
sizebefore:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
2>/dev/null; echo; fi
sizeafter:
@if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
2>/dev/null; echo; fi
# Display compiler version information.
gccversion :
@$(CC) --version
# Program the device.
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
# Generate avr-gdb config/init file which does the following:
# define the reset signal, load the target file, connect to target, and set
# a breakpoint at main().
gdb-config:
@$(REMOVE) $(GDBINIT_FILE)
@echo define reset >> $(GDBINIT_FILE)
@echo SIGNAL SIGHUP >> $(GDBINIT_FILE)
@echo end >> $(GDBINIT_FILE)
@echo file $(TARGET).elf >> $(GDBINIT_FILE)
@echo target remote $(DEBUG_HOST):$(DEBUG_PORT) >> $(GDBINIT_FILE)
ifeq ($(DEBUG_BACKEND),simulavr)
@echo load >> $(GDBINIT_FILE)
endif
@echo break main >> $(GDBINIT_FILE)
debug: gdb-config $(TARGET).elf
ifeq ($(DEBUG_BACKEND), avarice)
@echo Starting AVaRICE - Press enter when "waiting to connect" message displays.
@$(WINSHELL) /c start avarice --jtag $(JTAG_DEV) --erase --program --file \
$(TARGET).elf $(DEBUG_HOST):$(DEBUG_PORT)
@$(WINSHELL) /c pause
else
@$(WINSHELL) /c start simulavr --gdbserver --device $(MCU) --clock-freq \
$(DEBUG_MFREQ) --port $(DEBUG_PORT)
endif
@$(WINSHELL) /c start avr-$(DEBUG_UI) --command=$(GDBINIT_FILE)
# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB.
COFFCONVERT = $(OBJCOPY) --debugging
COFFCONVERT += --change-section-address .data-0x800000
COFFCONVERT += --change-section-address .bss-0x800000
COFFCONVERT += --change-section-address .noinit-0x800000
COFFCONVERT += --change-section-address .eeprom-0x810000
coff: $(TARGET).elf
@echo
@echo $(MSG_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-avr $< $(TARGET).cof
extcoff: $(TARGET).elf
@echo
@echo $(MSG_EXTENDED_COFF) $(TARGET).cof
$(COFFCONVERT) -O coff-ext-avr $< $(TARGET).cof
# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
@echo
@echo $(MSG_FLASH) $@
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
%.eep: %.elf
@echo
@echo $(MSG_EEPROM) $@
-$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) $< $@ || exit 0
# Create extended listing file from ELF output file.
%.lss: %.elf
@echo
@echo $(MSG_EXTENDED_LISTING) $@
$(OBJDUMP) -h -S $< > $@
# Create a symbol table from ELF output file.
%.sym: %.elf
@echo
@echo $(MSG_SYMBOL_TABLE) $@
$(NM) -n $< > $@
# Create library from object files.
.SECONDARY : $(TARGET).a
.PRECIOUS : $(OBJ)
%.a: $(OBJ)
@echo
@echo $(MSG_CREATING_LIBRARY) $@
$(AR) $@ $(OBJ)
# Link: create ELF output file from object files.
.SECONDARY : $(TARGET).elf
.PRECIOUS : $(OBJ)
%.elf: $(OBJ)
@echo
@echo $(MSG_LINKING) $@
$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
# Compile: create object files from C source files.
$(OBJDIR)/%.o : %.c
@echo
@echo $(MSG_COMPILING) $<
$(CC) -c $(ALL_CFLAGS) $< -o $@
# Compile: create object files from C++ source files.
$(OBJDIR)/%.o : %.cpp
@echo
@echo $(MSG_COMPILING_CPP) $<
$(CC) -c $(ALL_CPPFLAGS) $< -o $@
# Compile: create assembler files from C source files.
%.s : %.c
$(CC) -S $(ALL_CFLAGS) $< -o $@
# Compile: create assembler files from C++ source files.
%.s : %.cpp
$(CC) -S $(ALL_CPPFLAGS) $< -o $@
# Assemble: create object files from assembler source files.
$(OBJDIR)/%.o : %.S
@echo
@echo $(MSG_ASSEMBLING) $<
$(CC) -c $(ALL_ASFLAGS) $< -o $@
# Create preprocessed source for use in sending a bug report.
%.i : %.c
$(CC) -E -mmcu=$(MCU) -I. $(CFLAGS) $< -o $@
# Target: clean project.
clean: begin clean_list end
clean_list :
@echo
@echo $(MSG_CLEANING)
$(REMOVE) $(TARGET).bin
$(REMOVE) $(TARGET).hex
$(REMOVE) $(TARGET).eep
$(REMOVE) $(TARGET).cof
$(REMOVE) $(TARGET).elf
$(REMOVE) $(TARGET).map
$(REMOVE) $(TARGET).sym
$(REMOVE) $(TARGET).lss
$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.o)
$(REMOVE) $(SRC:%.c=$(OBJDIR)/%.lst)
$(REMOVE) $(SRC:.c=.s)
$(REMOVE) $(SRC:.c=.d)
$(REMOVE) $(SRC:.c=.i)
$(REMOVEDIR) .dep
# Create object files directory
$(shell mkdir $(OBJDIR) 2>/dev/null)
# Include the dependency files.
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
# Listing of phony targets.
.PHONY : all begin finish end sizebefore sizeafter gccversion \
build elf hex eep lss sym coff extcoff \
clean clean_list program debug gdb-config
-1070
View File
File diff suppressed because it is too large Load Diff
-174
View File
@@ -1,174 +0,0 @@
#ifdef __USI__
/****************************************************************************/
static void USI_TWI_SLAVE_Init( void );
static void USI_TWI_SLAVE_Abort(void);
static void USI_TWI_SLAVE_ReadAndProcessPacket(void);
static void USI_TWI_SLAVE_Process_Start_Condition(void);
void USI_TWI_SLAVE_Process_Overflow_Condition(void);
// void prog_buffer_set_byte(uint8_t );
// uint8_t bootloader_exit;
uint8_t Run_boot ;
#define TRUE 1
#define FALSE 0
// TWI write states.
#define USI_TWI_SLAVE_WRITE_ADDR_HI_BYTE (0x00)
#define USI_TWI_SLAVE_WRITE_ADDR_LO_BYTE (0x01)
#define USI_TWI_SLAVE_WRITE_DATA_BYTE (0x02)
// TWI overflow states.
#define USI_TWI_SLAVE_OVERFLOW_STATE_NONE (0x00)
#define USI_TWI_SLAVE_OVERFLOW_STATE_ACK_PR_RX (0x01)
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_RX (0x02)
#define USI_TWI_SLAVE_OVERFLOW_STATE_ACK_PR_TX (0x03)
#define USI_TWI_SLAVE_OVERFLOW_STATE_PR_ACK_TX (0x04)
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_TX (0x05)
// newly added ..
#define USI_TWI_SLAVE_OVERFLOW_STATE_CMD_RX (0x06)
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_TX_AVERSION (0x07)
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_TX_BVERSION (0x08)
#define USI_TWI_SLAVE_OVERFLOW_STATE_DATA_TX_GETERRCONDN (0x09)
//////////////////////////////////////////////////////////////////////
// typedef unsigned char uint8_t;
//////////////////////////////////////////////////////////////////
///////////////// Driver Buffer Definitions //////////////////////
//////////////////////////////////////////////////////////////////
// 1,2,4,8,16,32,64,128 or 256 bytes are allowed buffer sizes
#define TWI_RX_BUFFER_SIZE (16)
#define TWI_RX_BUFFER_MASK ( TWI_RX_BUFFER_SIZE - 1 )
#if ( TWI_RX_BUFFER_SIZE & TWI_RX_BUFFER_MASK )
#error TWI RX buffer size is not a power of 2
#endif
// 1,2,4,8,16,32,64,128 or 256 bytes are allowed buffer sizes
#define TWI_TX_BUFFER_SIZE (16)
#define TWI_TX_BUFFER_MASK ( TWI_TX_BUFFER_SIZE - 1 )
#if ( TWI_TX_BUFFER_SIZE & TWI_TX_BUFFER_MASK )
#error TWI TX buffer size is not a power of 2
#endif
#define USI_SLAVE_CHECK_ADDRESS (0x00)
#define USI_SLAVE_SEND_DATA (0x01)
#define USI_SLAVE_REQUEST_REPLY_FROM_SEND_DATA (0x02)
#define USI_SLAVE_CHECK_REPLY_FROM_SEND_DATA (0x03)
#define USI_SLAVE_REQUEST_DATA (0x04)
#define USI_SLAVE_GET_DATA_AND_SEND_ACK (0x05)
//////////////////////////////////////////////////////////////////////////
/*#if defined(__ATTINY2313__) | defined(__ATTINY2313A__) | \
defined(__ATTINY4313__) | defined(__ATTINY4313A__) */
// #define DDR_USI DDRB
// #define PORT_USI PORTB
// #define PIN_USI PINB
// #define PORT_USI_SDA PORTB5
// #define PORT_USI_SCL PORTB7
// #define PIN_USI_SDA PINB5
// #define PIN_USI_SCL PINB7
// #define USI_START_COND_INT USISIF
// #define USI_START_VECTOR USI_STRT_vect
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
//#endif
/*#if defined(__ATTINY25__) | defined(__ATTINY25V__) | \
// defined(__ATTINY45__) | defined(__ATTINY45V__) | \
// defined(__ATTINY85__) | defined(__ATTINY85V__) */
// #define DDR_USI DDRB
// #define PORT_USI PORTB
// #define PIN_USI PINB
// #define PORT_USI_SDA PORTB0
// #define PORT_USI_SCL PORTB2
// #define PIN_USI_SDA PINB0
// #define PIN_USI_SCL PINB2
// #define USI_START_COND_INT USICIF
// #define USI_START_VECTOR USI_START_vect
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
//#endif
/*#if defined(__ATTINY24__) | defined(__ATTINY24A__) | \
defined(__ATTINY44__) | defined(__ATTINY44A__) | \
defined(__ATTINY84__) | defined(__ATTINY84V__) */
// #define DDR_USI DDRA
// #define PORT_USI PORTA
// #define PIN_USI PINA
// #define PORT_USI_SDA PORTA6
// #define PORT_USI_SCL PORTA4
// #define PIN_USI_SDA PINA6
// #define PIN_USI_SCL PINA4
// #define USI_START_COND_INT USISIF
// #define USI_START_VECTOR USI_START_vect
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
//#endif
/*#if defined(__ATTINY261__) | defined(__ATTINY261A__) | \
defined(__ATTINY461__) | defined(__ATTINY461A__) | \
defined(__ATTINY861A__) | defined(__ATTINY861A__) */
// #define DDR_USI DDRB
// #define PORT_USI PORTB
// #define PIN_USI PINB
// #define PORT_USI_SDA PORTB0
// #define PORT_USI_SCL PORTB2
// #define PIN_USI_SDA PINB0
// #define PIN_USI_SCL PINB2
// #define USI_START_COND_INT USISIF
// #define USI_START_VECTOR USI_START_vect
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
//#endif
//#if defined(__ATTINY43U__)
// #define DDR_USI DDRB
// #define PORT_USI PORTB
// #define PIN_USI PINB
// #define PORT_USI_SDA PORTB4
// #define PORT_USI_SCL PORTB6
// #define PIN_USI_SDA PINB4
// #define PIN_USI_SCL PINB6
// #define USI_START_COND_INT USISIF
// #define USI_START_VECTOR USI_START_vect
// #define USI_OVERFLOW_VECTOR USI_OVF_vect
//#endif
//#if defined(__ATTINY87__) | defined(__ATTINY167__)
#define DDR_USI DDRB
#define PORT_USI PORTB
#define PIN_USI PINB
#define PORT_USI_SDA PORTB0
#define PORT_USI_SCL PORTB2
#define PIN_USI_SDA PINB0
#define PIN_USI_SCL PINB2
#define USI_START_COND_INT USISIF
#define USI_START_VECTOR USI_START_vect
#define USI_OVERFLOW_VECTOR USI_OVF_vect
//#endif
#endif
-231
View File
@@ -1,231 +0,0 @@
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
OUTPUT_ARCH(avr:3)
MEMORY
{
text (rx) : ORIGIN = 0, LENGTH = 16K
data (rw!x) : ORIGIN = 0x800060, LENGTH = 0xffa0
eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
}
SECTIONS
{
/* Read-only sections, merged into text segment: */
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
.dynstr : { *(.dynstr) }
.gnu.version : { *(.gnu.version) }
.gnu.version_d : { *(.gnu.version_d) }
.gnu.version_r : { *(.gnu.version_r) }
.rel.init : { *(.rel.init) }
.rela.init : { *(.rela.init) }
.rel.text :
{
*(.rel.text)
*(.rel.text.*)
*(.rel.gnu.linkonce.t*)
}
.rela.text :
{
*(.rela.text)
*(.rela.text.*)
*(.rela.gnu.linkonce.t*)
}
.rel.fini : { *(.rel.fini) }
.rela.fini : { *(.rela.fini) }
.rel.rodata :
{
*(.rel.rodata)
*(.rel.rodata.*)
*(.rel.gnu.linkonce.r*)
}
.rela.rodata :
{
*(.rela.rodata)
*(.rela.rodata.*)
*(.rela.gnu.linkonce.r*)
}
.rel.data :
{
*(.rel.data)
*(.rel.data.*)
*(.rel.gnu.linkonce.d*)
}
.rela.data :
{
*(.rela.data)
*(.rela.data.*)
*(.rela.gnu.linkonce.d*)
}
.rel.ctors : { *(.rel.ctors) }
.rela.ctors : { *(.rela.ctors) }
.rel.dtors : { *(.rel.dtors) }
.rela.dtors : { *(.rela.dtors) }
.rel.got : { *(.rel.got) }
.rela.got : { *(.rela.got) }
.rel.bss : { *(.rel.bss) }
.rela.bss : { *(.rela.bss) }
.rel.plt : { *(.rel.plt) }
.rela.plt : { *(.rela.plt) }
/* Internal text space or external memory. */
.vectors :
{
*(.vectors)
KEEP(*(.vectors))
}
.text :
{
/* For data that needs to reside in the lower 64k of progmem. */
*(.progmem.gcc*)
*(.progmem*)
. = ALIGN(2);
__trampolines_start = . ;
/* The jump trampolines for the 16-bit limited relocs will reside here. */
*(.trampolines)
*(.trampolines*)
__trampolines_end = . ;
/* For future tablejump instruction arrays for 3 byte pc devices.
We don't relax jump/call instructions within these sections. */
*(.jumptables)
*(.jumptables*)
/* For code that needs to reside in the lower 128k progmem. */
*(.lowtext)
*(.lowtext*)
__ctors_start = . ;
*(.ctors)
__ctors_end = . ;
__dtors_start = . ;
*(.dtors)
__dtors_end = . ;
KEEP(SORT(*)(.ctors))
KEEP(SORT(*)(.dtors))
/* From this point on, we don't bother about wether the insns are
below or above the 16 bits boundary. */
*(.init0) /* Start here after reset. */
KEEP (*(.init0))
*(.init1)
KEEP (*(.init1))
*(.init2) /* Clear __zero_reg__, set up stack pointer. */
KEEP (*(.init2))
*(.init3)
KEEP (*(.init3))
*(.init4) /* Initialize data and BSS. */
KEEP (*(.init4))
*(.init5)
KEEP (*(.init5))
*(.init6) /* C++ constructors. */
KEEP (*(.init6))
*(.init7)
KEEP (*(.init7))
*(.init8)
KEEP (*(.init8))
*(.init9) /* Call main(). */
KEEP (*(.init9))
*(.text)
. = ALIGN(2);
*(.text.*)
. = ALIGN(2);
*(.fini9) /* _exit() starts here. */
KEEP (*(.fini9))
*(.fini8)
KEEP (*(.fini8))
*(.fini7)
KEEP (*(.fini7))
*(.fini6) /* C++ destructors. */
KEEP (*(.fini6))
*(.fini5)
KEEP (*(.fini5))
*(.fini4)
KEEP (*(.fini4))
*(.fini3)
KEEP (*(.fini3))
*(.fini2)
KEEP (*(.fini2))
*(.fini1)
KEEP (*(.fini1))
*(.fini0) /* Infinite loop after program termination. */
KEEP (*(.fini0))
_etext = . ;
} > text
.data : AT (ADDR (.text) + SIZEOF (.text))
{
PROVIDE (__data_start = .) ;
*(.data)
*(.data*)
*(.rodata) /* We need to include .rodata here if gcc is used */
*(.rodata*) /* with -fdata-sections. */
*(.gnu.linkonce.d*)
. = ALIGN(2);
_edata = . ;
PROVIDE (__data_end = .) ;
} > data
.bss : AT (ADDR (.bss))
{
PROVIDE (__bss_start = .) ;
*(.bss)
*(.bss*)
*(COMMON)
PROVIDE (__bss_end = .) ;
} > data
__data_load_start = LOADADDR(.data);
__data_load_end = __data_load_start + SIZEOF(.data);
/* Global data not cleared after reset. */
.noinit :
{
PROVIDE (__noinit_start = .) ;
*(.noinit*)
PROVIDE (__noinit_end = .) ;
_end = . ;
PROVIDE (__heap_start = .) ;
} > data
.eeprom :
{
*(.eeprom*)
__eeprom_end = . ;
} > eeprom
.fuse :
{
KEEP(*(.fuse))
KEEP(*(.lfuse))
KEEP(*(.hfuse))
KEEP(*(.efuse))
} > fuse
.lock :
{
KEEP(*(.lock*))
} > lock
.signature :
{
KEEP(*(.signature*))
} > signature
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
.stab.excl 0 : { *(.stab.excl) }
.stab.exclstr 0 : { *(.stab.exclstr) }
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) }
/* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
}
-234
View File
@@ -1,234 +0,0 @@
# ----------------------------------------------------------------------------
# ATMEL Microcontroller Software Support
# ----------------------------------------------------------------------------
# Copyright (c) 2011, Atmel Corporation
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
#
# Atmel's name may not be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
# DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ----------------------------------------------------------------------------
# Makefile for compiling the applet-serial flash project
# Chip & board used for compilation
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
CHIP = atsam3s4
BOARD = atsam3s4_ek
DYN = OFF
# Makefile for compiling applet-serialflash applet.
ifeq (atsam3s4,$(CHIP))
BOARD_DIR = at91sam3s4-ek
endif
ifeq (atsam3s2,$(CHIP))
BOARD_DIR = at91sam3s2-ek
endif
ifeq (sam9g15,$(CHIP))
BOARD =sam9g15_ek
BOARD_DIR = at91sam9g15-ek
endif
ifeq (sam9g25,$(CHIP))
BOARD =sam9g25_ek
BOARD_DIR = at91sam9g25-ek
endif
ifeq (sam9g35,$(CHIP))
BOARD =sam9g35_ek
BOARD_DIR = at91sam9g35-ek
endif
ifeq (sam9x25,$(CHIP))
BOARD =sam9x25_ek
BOARD_DIR = at91sam9x25-ek
endif
ifeq (sam9x35,$(CHIP))
BOARD =sam9x35_ek
BOARD_DIR = at91sam9x35-ek
endif
# Defines which are the available memory targets for the AT91SAM3S-EK board.
MEMORIES = sram
# Trace level used for compilation
# (can be overriden by adding TRACE_LEVEL=#number to the command-line)
# TRACE_LEVEL_DEBUG 5
# TRACE_LEVEL_INFO 4
# TRACE_LEVEL_WARNING 3
# TRACE_LEVEL_ERROR 2
# TRACE_LEVEL_FATAL 1
# TRACE_LEVEL_NO_TRACE 0
# Info traces allowed by default
TR_LEV = 0
# Optimization level, put in comment for debugging
OPTIMIZATION = -Os
# Output file basename
OUTPUT = applet-coprocessor-$(CHIP)
# Output directories
BIN = bin
OBJ = obj
#-------------------------------------------------------------------------------
# Tools
#-------------------------------------------------------------------------------
# Tool suffix when cross-compiling
CROSS_COMPILE = arm-none-eabi-
# Libraries
LIBRARIES = ../../libraries
# Chip library directory
CHIP_LIB = $(LIBRARIES)/libchip_atsam3s
# Board library directory
BOARD_LIB = $(LIBRARIES)/libboard_atsam3s-ek
# Spiflash library directory
#SPIFLASH_LIB = $(LIBRARIES)/libspiflash
# ISP directory
ISP = ..
# tcl_lib directory
#INSTALLDIR = "../../../../tcl_lib/$(BOARD_DIR)/"
LIBS = -Wl,--start-group -lgcc -lc -Wl,--end-group
#-lchip_$(CHIP)_gcc_rel -lboard_$(BOARD)_gcc_rel -lspiflash_gcc_rel -Wl,--end-group
LIB_PATH = -L$(CHIP_LIB)/lib
LIB_PATH += -L$(BOARD_LIB)/lib
#LIB_PATH += -L$(SPIFLASH_LIB)/lib
#LIB_PATH+=-L=/lib
#LIB_PATH+=-L=/../lib/gcc/arm-none-eabi/4.4.1
# Compilation tools
AR = $(CROSS_COMPILE)ar
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
SIZE = $(CROSS_COMPILE)size
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
GDB = $(CROSS_COMPILE)gdb
NM = $(CROSS_COMPILE)nm
CLSS = $(CROSS_COMPILE)objdump
# Flags
INCLUDES = -I$(CHIP_LIB)
INCLUDES += -I$(BOARD_LIB)
INCLUDES += -I$(SPIFLASH_LIB)
INCLUDES += -I$(LIBRARIES)
CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int
CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
CFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings
CFLAGS += -Wsign-compare -Waggregate-return -Wstrict-prototypes
CFLAGS += -Wmissing-prototypes -Wmissing-declarations
CFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
CFLAGS += -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long
CFLAGS += -Wunreachable-code
CFLAGS += -Wcast-align
#CFLAGS += -Wmissing-noreturn
#CFLAGS += -Wconversion
# To reduce application size use only integer printf function.
CFLAGS += -Dprintf=iprintf
TRACE_LEVEL = 4
#CFLAGS += -DTRACE_LEVEL=$(TR_LEV)
#-DDYN_TRACES
# -mlong-calls -Wall
CFLAGS += -ffunction-sections -D$(MEMORIES)
#CFLAGS += -DNDEBUG
CFLAGS += -mthumb -g -gdwarf-2 $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_LEVEL=$(TRACE_LEVEL) -DDYN_TRACES
ASFLAGS = -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
LDFLAGS= -nostartfiles -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=entry -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols
LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
# Directories where source files can be found
VPATH += ../..
VPATH += $(ISP)/common
# Objects built from Asm source files
//ASM_OBJECTS = applet_cstartup.o
# Objects built from C source files
C_OBJECTS += main.o
C_OBJECTS += applet_cstartup.o
# Append OBJ and BIN directories to output filename
OUTPUT := $(BIN)/$(OUTPUT)
#-------------------------------------------------------------------------------
# Rules
#-------------------------------------------------------------------------------
all: $(BIN) $(OBJ) $(MEMORIES)
$(BIN) $(OBJ):
mkdir $@
define RULES
C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS))
ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))
$(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
$(CC) $(LIB_PATH) $(LDFLAGS) $(LD_OPTIONAL) -T"$(BOARD_LIB)/resources/gcc/$(CHIP)/$$@_samba.lds" -Wl,-Map,$(OUTPUT).map -o $(OUTPUT).elf $$^ $(LIBS)
$(NM) $(OUTPUT).elf >$(OUTPUT).elf.txt
$(OBJCOPY) -O binary $(OUTPUT).elf $(OUTPUT).bin
$(SIZE) $$^ $(OUTPUT).elf
$(CLSS) -h -S $(OUTPUT).elf >$(OUTPUT).lss
# @[ -e $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
# @cp -f $(OUTPUT).bin $(INSTALLDIR)
$$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
$(CC) $(CFLAGS) -D$(1) -c -o $$@ $$<
$$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
$(CC) $(ASFLAGS) -D$(1) -c -o $$@ $$<
debug_$(1): $(1)
$(GDB) -x "$(BOARD_LIB)/resources/gcc/$(BOARD)_$(1).gdb" -ex "reset" -readnow -se $(OUTPUT)-$(1).elf
endef
$(foreach MEMORY, $(MEMORIES), $(eval $(call RULES,$(MEMORY))))
clean:
-del $(OBJ)\*.o $(BIN)\*.bin $(BIN)\*.elf $(BIN)\*.map
# Create extended listing file from ELF output file.
%.lss: %.elf
@echo
@echo $(MSG_EXTENDED_LISTING) $@
$(OBJDUMP) -h -S $< > $@
File diff suppressed because it is too large Load Diff
-101
View File
@@ -1,101 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2008, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
#ifndef APPLET_H
#define APPLET_H
/*----------------------------------------------------------------------------
* Global definitions
*----------------------------------------------------------------------------*/
/** Refers to the Version of SAM-BA */
#define SAM_BA_APPLETS_VERSION "2.11"
/** Applet initialization command code.*/
#define APPLET_CMD_INIT 0x00
/** Applet full erase command code.*/
#define APPLET_CMD_FULL_ERASE 0x01
/** Applet write command code.*/
#define APPLET_CMD_WRITE 0x02
/** Applet read command code.*/
#define APPLET_CMD_READ 0x03
/** Applet read command code.*/
#define APPLET_CMD_LOCK 0x04
/** Applet read command code.*/
#define APPLET_CMD_UNLOCK 0x05
/** Applet set/clear GPNVM command code.*/
#define APPLET_CMD_GPNVM 0x06
/** Applet set security bit command code.*/
#define APPLET_CMD_SECURITY 0x07
/** Applet buffer erase command code.*/
#define APPLET_CMD_BUFFER_ERASE 0x08
/** Applet binary page command code for Dataflash.*/
#define APPLET_CMD_BINARY_PAGE 0x09
/** List Bad Blocks of a Nandflash*/
#define APPLET_CMD_LIST_BAD_BLOCKS 0x10
/** Tag a Nandflash Block*/
#define APPLET_CMD_TAG_BLOCK 0x11
/** Read the Unique ID bits (on SAM3)*/
#define APPLET_CMD_READ_UNIQUE_ID 0x12
/** Applet blocks erase command code. */
#define APPLET_CMD_ERASE_BLOCKS 0x13
/** Applet batch full erase command code. */
#define APPLET_CMD_BATCH_ERASE 0x14
/** Operation was successful.*/
#define APPLET_SUCCESS 0x00
/** Device unknown.*/
#define APPLET_DEV_UNKNOWN 0x01
/** Write operation failed.*/
#define APPLET_WRITE_FAIL 0x02
/** Read operation failed.*/
#define APPLET_READ_FAIL 0x03
/** Protect operation failed.*/
#define APPLET_PROTECT_FAIL 0x04
/** Unprotect operation failed.*/
#define APPLET_UNPROTECT_FAIL 0x05
/** Erase operation failed.*/
#define APPLET_ERASE_FAIL 0x06
/** No device defined in board.h*/
#define APPLET_NO_DEV 0x07
/** Read / write address is not aligned*/
#define APPLET_ALIGN_ERROR 0x08
/** Read / write found bad block*/
#define APPLET_BAD_BLOCK 0x09
/** Applet failure.*/
#define APPLET_FAIL 0x0f
/** Communication link identification*/
#define USB_COM_TYPE 0x00
#define DBGU_COM_TYPE 0x01
#define JTAG_COM_TYPE 0x02
#endif //#ifndef APPLET_H
-128
View File
@@ -1,128 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2011, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "board.h"
#include "board_lowlevel.h"
typedef void( *IntFunc )( void );
/*----------------------------------------------------------------------------
* Prototypes
*----------------------------------------------------------------------------*/
/** Stack top */
extern unsigned long _sstack;
/** Initialize segments*/
extern unsigned int _sidata;
extern unsigned int _sdata, _edata;
extern unsigned int _szero, _ezero;
/** Default link entry */
extern int main(int argc, char **argv);
/** Reset entry */
void ResetException(void) ;//__attribute__((__interrupt__));
/** Exception Table */
__attribute__((section(".isr_vector")))
//IntFunc exception_table[] = {
//__attribute__ ((section(".vectors"), used))
void (* const gVectors[])(void) =
{
/* Configure Initial Stack Pointer, using linker-generated symbols */
(void (*)(void))((unsigned long)&_sstack),
// /*(IntFunc)&*/_sstack,
ResetException, /* Initial PC, set to entry point */
(unsigned int) 0 /*NMIException*/,
(unsigned int) 0 /*HardFaultException*/,
(unsigned int) 0 /*MemManageException*/,
(unsigned int) 0 /*BusFaultException*/,
(unsigned int) 0 /*UsageFaultException*/,
0, 0, 0, 0, /* Reserved */
(unsigned int) 0 /*SVCHandler*/,
(unsigned int) 0 /*DebugMonitor*/,
0, /* Reserved */
(unsigned int) 0 /*PendSVC*/,
(unsigned int) 0 /*SysTickHandler*/,
/*
:
*/
};
/** Applet Mailbox and initialization flag */
#define MAILBOX_SIZE 32
__attribute__((section(".mailbox")))
unsigned int mailbox[MAILBOX_SIZE];
volatile unsigned int isInitialized = 0;
/*----------------------------------------------------------------------------
* Reset Handler
*----------------------------------------------------------------------------*/
/**
* \brief This is the code that gets called on processor reset. To initialize the
* device. And call the main() routine.
*
*/
__attribute__ ((section(".text"), used))
void ResetException(void)
{
unsigned int *pSrc, *pDest;
// { asm volatile ("cpsid i"); }
// Initialize data
// Zero fill bss
if (isInitialized == 0) {
pSrc = &_sidata;
for(pDest = &_sdata; pDest < &_edata;) {
*(pDest ++) = *(pSrc ++);
}
for (pDest = &_szero; pDest < &_ezero;) {
*(pDest ++) = 0;
}
isInitialized = 1;
}
/* LowLevelInit(); */
/* Save original SP. */
__asm("mov r4, sp");
/* Change SP to current stack point. */
__asm("ldr r5, =_sstack");
__asm(" mov sp, r5");
main(1, (char**)mailbox);
/* Restore previous SP point. */
__asm("mov sp, r4");
}
-46
View File
@@ -1,46 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/**
* \file
*
* Interface for the low-level initialization function.
*
*/
#ifndef BOARD_LOWLEVEL_H
#define BOARD_LOWLEVEL_H
/*----------------------------------------------------------------------------
* Exported functions
*----------------------------------------------------------------------------*/
extern void LowLevelInit( void ) ;
#endif /* BOARD_LOWLEVEL_H */
-235
View File
@@ -1,235 +0,0 @@
# ----------------------------------------------------------------------------
# ATMEL Microcontroller Software Support
# ----------------------------------------------------------------------------
# Copyright (c) 2011, Atmel Corporation
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyright notice,
# this list of conditions and the disclaimer below.
#
# Atmel's name may not be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
# DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ----------------------------------------------------------------------------
# Makefile for compiling the applet-serial flash project
# Chip & board used for compilation
# (can be overriden by adding CHIP=chip and BOARD=board to the command-line)
CHIP = atsam3s4
BOARD = atsam3s4_ek
DYN = OFF
# Makefile for compiling applet-serialflash applet.
ifeq (atsam3s4,$(CHIP))
BOARD_DIR = at91sam3s4-ek
endif
ifeq (atsam3s2,$(CHIP))
BOARD_DIR = at91sam3s2-ek
endif
ifeq (sam9g15,$(CHIP))
BOARD =sam9g15_ek
BOARD_DIR = at91sam9g15-ek
endif
ifeq (sam9g25,$(CHIP))
BOARD =sam9g25_ek
BOARD_DIR = at91sam9g25-ek
endif
ifeq (sam9g35,$(CHIP))
BOARD =sam9g35_ek
BOARD_DIR = at91sam9g35-ek
endif
ifeq (sam9x25,$(CHIP))
BOARD =sam9x25_ek
BOARD_DIR = at91sam9x25-ek
endif
ifeq (sam9x35,$(CHIP))
BOARD =sam9x35_ek
BOARD_DIR = at91sam9x35-ek
endif
# Defines which are the available memory targets for the AT91SAM3S-EK board.
MEMORIES = sram
# Trace level used for compilation
# (can be overriden by adding TRACE_LEVEL=#number to the command-line)
# TRACE_LEVEL_DEBUG 5
# TRACE_LEVEL_INFO 4
# TRACE_LEVEL_WARNING 3
# TRACE_LEVEL_ERROR 2
# TRACE_LEVEL_FATAL 1
# TRACE_LEVEL_NO_TRACE 0
# Info traces allowed by default
TR_LEV = 0
# Optimization level, put in comment for debugging
OPTIMIZATION = -Os
# Output file basename
OUTPUT = applet-serialflash-$(CHIP)
# Output directories
BIN = bin
OBJ = obj
#-------------------------------------------------------------------------------
# Tools
#-------------------------------------------------------------------------------
# Tool suffix when cross-compiling
CROSS_COMPILE = arm-none-eabi-
# Libraries
LIBRARIES = ../../libraries
# Chip library directory
CHIP_LIB = $(LIBRARIES)/libchip_atsam3s
# Board library directory
BOARD_LIB = $(LIBRARIES)/libboard_atsam3s-ek
# Spiflash library directory
#SPIFLASH_LIB = $(LIBRARIES)/libspiflash
# ISP directory
ISP = ..
# tcl_lib directory
#INSTALLDIR = "../../../../tcl_lib/$(BOARD_DIR)/"
LIBS = -Wl,--start-group -lgcc -lc -Wl,--end-group
#-lchip_$(CHIP)_gcc_rel -lboard_$(BOARD)_gcc_rel -lspiflash_gcc_rel -Wl,--end-group
LIB_PATH = -L$(CHIP_LIB)/lib
LIB_PATH += -L$(BOARD_LIB)/lib
#LIB_PATH += -L$(SPIFLASH_LIB)/lib
#LIB_PATH+=-L=/lib
#LIB_PATH+=-L=/../lib/gcc/arm-none-eabi/4.4.1
# Compilation tools
AR = $(CROSS_COMPILE)ar
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
SIZE = $(CROSS_COMPILE)size
STRIP = $(CROSS_COMPILE)strip
OBJCOPY = $(CROSS_COMPILE)objcopy
GDB = $(CROSS_COMPILE)gdb
NM = $(CROSS_COMPILE)nm
CLSS = $(CROSS_COMPILE)objdump
# Flags
INCLUDES = -I$(CHIP_LIB)
INCLUDES += -I$(BOARD_LIB)
INCLUDES += -I$(SPIFLASH_LIB)
INCLUDES += -I$(LIBRARIES)
CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wformat=2 -Wimplicit-int
CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses
CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs -Wunused
CFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal -Wundef
CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings
CFLAGS += -Wsign-compare -Waggregate-return -Wstrict-prototypes
CFLAGS += -Wmissing-prototypes -Wmissing-declarations
CFLAGS += -Wformat -Wmissing-format-attribute -Wno-deprecated-declarations
CFLAGS += -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wlong-long
CFLAGS += -Wunreachable-code
CFLAGS += -Wcast-align
#CFLAGS += -Wmissing-noreturn
#CFLAGS += -Wconversion
# To reduce application size use only integer printf function.
CFLAGS += -Dprintf=iprintf
TRACE_LEVEL = 4
#CFLAGS += -DTRACE_LEVEL=$(TR_LEV)
#-DDYN_TRACES
# -mlong-calls -Wall
CFLAGS += -ffunction-sections -D$(MEMORIES)
#CFLAGS += -DNDEBUG
CFLAGS += -mthumb -g -gdwarf-2 $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_LEVEL=$(TRACE_LEVEL) -DDYN_TRACES
ASFLAGS = -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
LDFLAGS= -nostartfiles -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=entry -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols
LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats
#-------------------------------------------------------------------------------
# Files
#-------------------------------------------------------------------------------
# Directories where source files can be found
VPATH += ../..
VPATH += $(ISP)/common
# Objects built from Asm source files
//ASM_OBJECTS = applet_cstartup.o
# Objects built from C source files
C_OBJECTS += main.o
C_OBJECTS += applet_cstartup.o
# Append OBJ and BIN directories to output filename
OUTPUT := $(BIN)/$(OUTPUT)
#-------------------------------------------------------------------------------
# Rules
#-------------------------------------------------------------------------------
all: $(BIN) $(OBJ) $(MEMORIES)
$(BIN) $(OBJ):
mkdir $@
define RULES
C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS))
ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))
$(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
$(CC) $(LIB_PATH) $(LDFLAGS) $(LD_OPTIONAL) -T"$(BOARD_LIB)/resources/gcc/$(CHIP)/$$@_samba.lds" -Wl,-Map,$(OUTPUT).map -o $(OUTPUT).elf $$^ $(LIBS)
$(NM) $(OUTPUT).elf >$(OUTPUT).elf.txt
$(OBJCOPY) -O binary $(OUTPUT).elf $(OUTPUT).bin
$(SIZE) $$^ $(OUTPUT).elf
$(CLSS) -h -S $(OUTPUT).elf >$(OUTPUT).lss
# @[ -e $(INSTALLDIR) ] || mkdir $(INSTALLDIR)
# @cp -f $(OUTPUT).bin $(INSTALLDIR)
$$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN)
$(CC) $(CFLAGS) -D$(1) -c -o $$@ $$<
$$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN)
$(CC) $(ASFLAGS) -D$(1) -c -o $$@ $$<
debug_$(1): $(1)
$(GDB) -x "$(BOARD_LIB)/resources/gcc/$(BOARD)_$(1).gdb" -ex "reset" -readnow -se $(OUTPUT)-$(1).elf
endef
$(foreach MEMORY, $(MEMORIES), $(eval $(call RULES,$(MEMORY))))
clean:
-del $(OBJ)\*.o $(BIN)\*.bin $(BIN)\*.elf $(BIN)\*.map
# Create extended listing file from ELF output file.
%.lss: %.elf
@echo
@echo $(MSG_EXTENDED_LISTING) $@
$(OBJDUMP) -h -S $< > $@
-971
View File
@@ -1,971 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2011, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "../common/applet.h"
#include <board.h>
//#include "libspiflash.h"
#include <string.h>
#undef DYN_TRACES
#define DYN_TRACES 0
/*----------------------------------------------------------------------------
* Internal definitions
*----------------------------------------------------------------------------*/
/** SPI clock frequency in Hz. */
#define SPCK 8000000
/** Stack size in SRAM */
#define STACK_SIZE 0x100
/** Last erased sector id, this will avoid to erase if the block is already erased. */
//static unsigned short lastErasedBlock = 0xFFFF;
/** Indicate the farthest memory offset ever erase, if current write address is less
than the address, the related block should be erase again before write. */
//static uint32_t writtenAddress = 0;
/** Max size of data we can tranfsert in one shot */
#define MAX_COUNT 0x6000
/** Chip select value used to select the AT25 chip. */
#define SPI_CS 0
/** SPI peripheral pins to configure to access the serial flash. */
#define SPI_PINS PINS_SPI0, PIN_SPI0_NPCS0
/*----------------------------------------------------------------------------
* Types
*----------------------------------------------------------------------------*/
/** Structure for storing parameters for each command that can be performed by
the applet. */
struct _Mailbox {
/** Command send to the monitor to be executed. */
uint32_t command;
/** Returned status, updated at the end of the monitor execution.*/
uint32_t status;
/** Input Arguments in the argument area*/
union {
/** Input arguments for the Init command.*/
struct {
/** Communication link used.*/
uint32_t comType;
/**Trace level.*/
uint32_t traceLevel;
/** Serial flash index.*/
uint32_t at25Idx;
} inputInit;
/** Output arguments for the Init command.*/
struct {
/** Memory size.*/
uint32_t memorySize;
/** Buffer address.*/
uint32_t bufferAddress;
/** Buffer size.*/
uint32_t bufferSize;
} outputInit;
/** Input arguments for the Write command.*/
struct {
/** Buffer address.*/
uint32_t bufferAddr;
/** Buffer size.*/
uint32_t bufferSize;
/** Memory offset.*/
uint32_t memoryOffset;
} inputWrite;
/** Output arguments for the Write command.*/
struct {
/** Bytes written.*/
uint32_t bytesWritten;
uint32_t bufferSize; // temp
/** Memory offset.*/
uint32_t memoryOffset; // temp
uint32_t debug1 ;
uint32_t debug2 ;
} outputWrite;
/** Input arguments for the Read command.*/
struct {
/** Buffer address. */
uint32_t bufferAddr;
/** Buffer size.*/
uint32_t bufferSize;
/** Memory offset.*/
uint32_t memoryOffset;
} inputRead;
/** Output arguments for the Read command.*/
struct {
/** Bytes read.*/
uint32_t bytesRead;
} outputRead;
/** Input arguments for the Full Erase command.*/
// NONE
/** Output arguments for the Full Erase command.*/
// NONE
/** Input arguments for the Buffer Erase command.*/
struct {
/** Memory offset to be erase.*/
uint32_t memoryOffset;
} inputBufferErase;
/** Output arguments for the Buffer Erase command.*/
struct {
/** Memory offset to be erase.*/
uint32_t bytesErased;
} outputBufferErase;
} argument;
};
/*----------------------------------------------------------------------------
* Global variables
*----------------------------------------------------------------------------*/
/** End of program space (code + data). */
extern int end;
extern int _sstack;
/*----------------------------------------------------------------------------
* Local variables
*----------------------------------------------------------------------------*/
/** Global DMA driver instance for all DMA transfers in application. */
//static sDmad dmad;
/** SPI driver instance. */
//static Spid spid;
/** Serial flash driver instance. */
//static At25 at25;
/** Pins to configure for the application. */
//static Pin pins[] = {SPI_PINS};
/** Size of one page in the serial flash, in bytes. */
static uint32_t pageSize;
/** Size of one block in the serial flash, in bytes. */
static uint32_t blockSize;
/**Size of the buffer used for read/write operations in bytes. */
static uint32_t bufferSize;
/** Depending on DYN_TRACES, dwTraceLevel is a modifable runtime variable or a define */
uint32_t dwTraceLevel;
uint32_t Spi_init_done = 0 ;
struct _Mailbox *Pmailbox = 0 ;
uint8_t Spi_tx_buf[24] ;
uint8_t Spi_rx_buf[24] ;
uint8_t Block_buffer[4096] ;
/*----------------------------------------------------------------------------
* Global functions
*----------------------------------------------------------------------------*/
uint32_t eeprom_write_one( uint8_t byte, uint8_t count ) ;
uint32_t eeprom_read_status( void ) ;
void eeprom_write_enable( void ) ;
void eeprom_wait_busy( void ) ;
uint32_t spi_operation( register uint8_t *tx, register uint8_t *rx, register uint32_t count ) ;
void init_spi( void ) ;
uint32_t unprotect_eeprom( void ) ;
uint32_t spi_PDC_action( register uint8_t *command, register uint8_t *tx, register uint8_t *rx, register uint32_t comlen, register uint32_t count ) ;
uint32_t eeprom_block_erased( register uint8_t *p) ;
uint32_t eeprom_page_erased( register uint8_t *p) ;
void AT25D_Read( uint8_t *BufferAddr, uint32_t size, uint32_t memoryOffset) ;
void AT25D_Write( uint8_t *BufferAddr, uint32_t size, uint32_t memoryOffset ) ;
uint32_t AT25D_EraseBlock( uint32_t memoryOffset ) ;
//uint32_t min( uint32_t a, uint32_t b ) ;
uint32_t eeprom_write_one( uint8_t byte, uint8_t count )
{
register Spi *spiptr ;
register uint32_t result ;
spiptr = SPI ;
spiptr->SPI_CR = 1 ; // Enable
(void) spiptr->SPI_RDR ; // Dump any rx data
spiptr->SPI_TDR = byte ;
result = 0 ;
while( ( spiptr->SPI_SR & SPI_SR_RDRF ) == 0 )
{
// wait for received
if ( ++result > 10000 )
{
break ;
}
}
if ( count == 0 )
{
spiptr->SPI_CR = 2 ; // Disable
return spiptr->SPI_RDR ;
}
(void) spiptr->SPI_RDR ; // Dump the rx data
spiptr->SPI_TDR = 0 ;
result = 0 ;
while( ( spiptr->SPI_SR & SPI_SR_RDRF ) == 0 )
{
// wait for received
if ( ++result > 10000 )
{
break ;
}
}
spiptr->SPI_CR = 2 ; // Disable
return spiptr->SPI_RDR ;
}
uint32_t eeprom_read_status()
{
return eeprom_write_one( 5, 1 ) ;
}
void eeprom_write_enable()
{
eeprom_write_one( 6, 0 ) ;
}
void eeprom_wait_busy()
{
register uint32_t x ;
register uint32_t y ;
y = 0 ;
do
{
y += 1 ;
if ( y > 1000000 )
{
break ;
}
x = eeprom_read_status() ;
} while ( x & 1 ) ;
Pmailbox->argument.outputWrite.debug2 = y ;
}
uint32_t spi_operation( register uint8_t *tx, register uint8_t *rx, register uint32_t count )
{
register Spi *spiptr ;
register uint32_t result ;
// PMC->PMC_PCER0 |= 0x00200000L ; // Enable peripheral clock to SPI
result = 0 ;
spiptr = SPI ;
spiptr->SPI_CR = 1 ; // Enable
(void) spiptr->SPI_RDR ; // Dump any rx data
while( count )
{
result = 0 ;
while( ( spiptr->SPI_SR & SPI_SR_TXEMPTY ) == 0 )
{
// wait
if ( ++result > 10000 )
{
result = 0xFFFF ;
break ;
}
}
if ( result > 10000 )
{
break ;
}
// if ( count == 1 )
// {
// spiptr->SPI_CR = SPI_CR_LASTXFER ; // LastXfer bit
// }
spiptr->SPI_TDR = *tx++ ;
result = 0 ;
while( ( spiptr->SPI_SR & SPI_SR_RDRF ) == 0 )
{
// wait for received
if ( ++result > 10000 )
{
result = 0x2FFFF ;
break ;
}
}
if ( result > 10000 )
{
break ;
}
*rx++ = spiptr->SPI_RDR ;
count -= 1 ;
}
if ( result <= 10000 )
{
result = 0 ;
}
spiptr->SPI_CR = 2 ; // Disable
// Power save
// PMC->PMC_PCER0 &= ~0x00200000L ; // Disable peripheral clock to SPI
return result ;
}
uint32_t spi_PDC_action( register uint8_t *command, register uint8_t *tx, register uint8_t *rx, register uint32_t comlen, register uint32_t count )
{
register Spi *spiptr ;
// register uint32_t result ;
register uint32_t condition ;
static uint8_t discard_rx_command[4] ;
// PMC->PMC_PCER0 |= 0x00200000L ; // Enable peripheral clock to SPI
// Spi_complete = 0 ;
if ( comlen > 4 )
{
// Spi_complete = 1 ;
return 0x4FFFF ;
}
condition = SPI_SR_TXEMPTY ;
spiptr = SPI ;
spiptr->SPI_CR = 1 ; // Enable
(void) spiptr->SPI_RDR ; // Dump any rx data
(void) spiptr->SPI_SR ; // Clear error flags
spiptr->SPI_RPR = (uint32_t)discard_rx_command ;
spiptr->SPI_RCR = comlen ;
if ( rx )
{
spiptr->SPI_RNPR = (uint32_t)rx ;
spiptr->SPI_RNCR = count ;
condition = SPI_SR_RXBUFF ;
}
spiptr->SPI_TPR = (uint32_t)command ;
spiptr->SPI_TCR = comlen ;
if ( tx )
{
spiptr->SPI_TNPR = (uint32_t)tx ;
}
else
{
spiptr->SPI_TNPR = (uint32_t)rx ;
}
spiptr->SPI_TNCR = count ;
spiptr->SPI_PTCR = SPI_PTCR_RXTEN | SPI_PTCR_TXTEN ; // Start transfers
// Wait for things to get started, avoids early interrupt
for ( count = 0 ; count < 1000 ; count += 1 )
{
if ( ( spiptr->SPI_SR & SPI_SR_TXEMPTY ) == 0 )
{
break ;
}
}
count = 0 ;
while( ( spiptr->SPI_SR & condition ) == 0 )
{
if ( ++count > 1000000 )
{
break ;
}
}
spiptr->SPI_CR = 2 ; // Disable
(void) spiptr->SPI_RDR ; // Dump any rx data
(void) spiptr->SPI_SR ; // Clear error flags
spiptr->SPI_PTCR = SPI_PTCR_RXTDIS | SPI_PTCR_TXTDIS ; // Stop tramsfers
if ( count > 1000000 )
{
return 1 ;
}
return 0 ;
}
uint32_t unprotect_eeprom()
{
register uint8_t *p ;
eeprom_write_enable() ;
p = Spi_tx_buf ;
*p = 0x39 ; // Unprotect sector command
*(p+1) = 0 ;
*(p+2) = 0 ;
*(p+3) = 0 ; // 3 bytes address
return spi_operation( p, Spi_rx_buf, 4 ) ;
}
void init_spi()
{
register Pio *pioptr ;
register Spi *spiptr ;
register uint32_t timer ;
register uint8_t *p ;
uint8_t spi_buf[4] ;
if ( !Spi_init_done)
{
PMC->PMC_PCER0 |= 0x00200000L ; // Enable peripheral clock to SPI
/* Configure PIO */
pioptr = PIOA ;
pioptr->PIO_ABCDSR[0] &= ~0x00007800 ; // Peripheral A bits 14,13,12,11
pioptr->PIO_ABCDSR[1] &= ~0x00007800 ; // Peripheral A
pioptr->PIO_PDR = 0x00007800 ; // Assign to peripheral
spiptr = SPI ;
timer = ( 64000000 / 3000000 ) << 8 ;
spiptr->SPI_MR = 0x14000011 ; // 0001 0100 0000 0000 0000 0000 0001 0001 Master
spiptr->SPI_CSR[0] = 0x01180009 | timer ; // 0000 0001 0001 1000 xxxx xxxx 0000 1001
// NVIC_EnableIRQ(SPI_IRQn) ;
p = spi_buf ;
// *p = 0x39 ; // Unprotect sector command
// *(p+1) = 0 ;
// *(p+2) = 0 ;
// *(p+3) = 0 ; // 3 bytes address
// spi_operation( p, spi_buf, 4 ) ;
eeprom_write_enable() ;
*p = 1 ; // Write status register command
*(p+1) = 0 ;
spi_operation( p, spi_buf, 2 ) ;
Spi_init_done = 1 ;
}
}
uint32_t eeprom_block_erased( register uint8_t *p)
{
register uint32_t x ;
register uint32_t result ;
result = 1 ;
for ( x = 0 ; x < 4096 ; x += 1 )
{
if ( *p++ != 0xFF )
{
result = 0 ;
break ;
}
}
return result ;
}
uint32_t eeprom_page_erased( register uint8_t *p)
{
register uint32_t x ;
register uint32_t result ;
result = 1 ;
for ( x = 0 ; x < 256 ; x += 1 )
{
if ( *p++ != 0xFF )
{
result = 0 ;
break ;
}
}
return result ;
}
void AT25D_Read( uint8_t *BufferAddr, uint32_t size, uint32_t memoryOffset)
{
register uint8_t *p ;
p = Spi_tx_buf ;
*p = 3 ; // Read command
*(p+1) = memoryOffset >> 16 ;
*(p+2) = memoryOffset >> 8 ;
*(p+3) = memoryOffset ; // 3 bytes address
spi_PDC_action( p, 0, BufferAddr, 4, size ) ;
}
void AT25D_Write( uint8_t *BufferAddr, uint32_t size, uint32_t memoryOffset )
{
register uint8_t *p ;
eeprom_write_enable() ;
p = Spi_tx_buf ;
*p = 2 ; // Write command
*(p+1) = memoryOffset >> 16 ;
*(p+2) = memoryOffset >> 8 ;
*(p+3) = memoryOffset ; // 3 bytes address
spi_PDC_action( p, BufferAddr, 0, 4, size ) ;
eeprom_wait_busy() ;
}
uint32_t AT25D_EraseBlock( uint32_t memoryOffset )
{
register uint8_t *p ;
register uint32_t x ;
eeprom_write_enable() ;
p = Spi_tx_buf ;
*p = 0x20 ; // Block Erase command
*(p+1) = memoryOffset >> 16 ;
*(p+2) = memoryOffset >> 8 ;
*(p+3) = memoryOffset ; // 3 bytes address
x = spi_operation( p, Spi_rx_buf, 4 ) ;
eeprom_wait_busy() ;
return x ;
}
//uint32_t min( uint32_t a, uint32_t b )
//{
// if ( a < b )
// {
// return a ;
// }
// return b ;
//}
/**
* \brief Applet main entry. This function decodes received command and executes it.
* \param argc always 1
* \param argv Address of the argument area.
*/
int main(int argc, char **argv)
{
struct _Mailbox *pMailbox = (struct _Mailbox *) argv;
Pmailbox = pMailbox ;
/* Communication type with SAM-BA GUI. */
// uint8_t comType;
// uint32_t jedecId;
uint32_t bytesToWrite, bytesToRead, bufferAddr, startMemoryOffset, memoryOffset, packetSize;
/* index on read/write buffer */
uint8_t *pBuffer;
/* Temporary buffer used for non block aligned read/write */
// uint32_t tempBufferAddr;
/* Offset in destination buffer during buffer copy */
// uint32_t bufferOffset;
uint32_t block_address ;
uint32_t x ;
/* INIT */
/* Save communication link type */
// comType = pMailbox->argument.inputInit.comType;
init_spi() ;
if (pMailbox->command == APPLET_CMD_INIT)
{
#if (DYN_TRACES == 1)
dwTraceLevel = pMailbox->argument.inputInit.traceLevel;
#endif
// TRACE_INFO("-- SerialFlash AT25/AT26 applet %s --\n\r", SAM_BA_APPLETS_VERSION);
// TRACE_INFO("-- %s\n\r", BOARD_NAME);
// TRACE_INFO("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);
/* Configure pins */
// PIO_Configure(pins, PIO_LISTSIZE(pins));
/* Initialize DMA driver instance with polling mode */
// DMAD_Initialize( &dmad, 1 );
/* Initialize the SPI and serial flash */
init_spi() ;
// SPID_Configure(&spid, SPI0, ID_SPI0, &dmad);
// AT25_Configure(&at25, &spid, SPI_CS, 1);
// TRACE_INFO("SPI and AT25/AT25 drivers initialized\n\r");
pMailbox->argument.outputInit.bufferAddress = (uint32_t) &end ;
/* Read the JEDEC ID of the device to identify it */
// jedecId = AT25D_ReadJedecId(&at25);
// if (AT25_FindDevice(&at25, jedecId) == 0) {
// pMailbox->status = APPLET_DEV_UNKNOWN;
// pMailbox->argument.outputInit.bufferSize = 0;
// pMailbox->argument.outputInit.memorySize = 0;
// TRACE_INFO("Device Unknown\n\r");
// goto exit;
// }
// else {
/* Get device parameters */
pMailbox->status = APPLET_SUCCESS;
pageSize = 256 ;
// pageSize = AT25_PageSize(&at25);
blockSize = 4096 ;
// blockSize = AT25_BlockSize(&at25);
/* Program page */
// if (AT25_ManId(&at25) == SST_SPI_FLASH) {
/* SST Flash write is slower, we reduce buffer size to avoid USB timeout */
// bufferSize = 10 * pageSize;
// }
// else {
bufferSize = 2 * blockSize;
// }
/* integer number of pages can be contained in each buffer */
bufferSize -= bufferSize % pageSize;
if ( bufferSize < pageSize) {
// TRACE_INFO("No enought memory to load buffer.\n\r");
goto exit;
}
pMailbox->argument.outputInit.bufferSize = bufferSize;
pMailbox->argument.outputInit.memorySize = 128*4096;
// TRACE_INFO("%s blockSize : 0x%lx bufferAddr : 0x%lx\n\r",
// "sky9x", blockSize, pMailbox->argument.outputInit.bufferAddress);
// }
}
// ----------------------------------------------------------
// WRITE:
// ----------------------------------------------------------
else if (pMailbox->command == APPLET_CMD_WRITE)
{
startMemoryOffset = pMailbox->argument.inputWrite.memoryOffset;
memoryOffset = startMemoryOffset;
bufferAddr = pMailbox->argument.inputWrite.bufferAddr;
// tempBufferAddr = bufferAddr + bufferSize;
bytesToWrite = pMailbox->argument.inputWrite.bufferSize;
// TRACE_INFO("WRITE at offset: 0x%lx buffer at : 0x%lx of: 0x%lx Bytes\n\r",
// memoryOffset, bufferAddr, bytesToWrite);
/* Check word alignment */
if (memoryOffset % 4) {
pMailbox->status = APPLET_ALIGN_ERROR;
goto exit;
}
unprotect_eeprom() ;
// if (AT25D_Unprotect(&at25)) {
// TRACE_INFO("Can not unprotect the flash\n\r");
// pMailbox->status = APPLET_UNPROTECT_FAIL;
// goto exit;
// }
pBuffer = (uint8_t *) bufferAddr;
block_address = memoryOffset &0xFFFFF000 ; // 4k boundary
AT25D_Read( Block_buffer, 4096, block_address ) ; // read block to write to
// Check to see if it is blank
x = eeprom_block_erased( Block_buffer ) ;
if ( x == 0 )
{
AT25D_EraseBlock( block_address ) ;
}
if (bytesToWrite)
{
uint32_t bytes_to_copy ;
uint32_t i ;
uint32_t j ;
uint8_t *s ;
uint8_t *dest ;
dest = Block_buffer + (memoryOffset & 0x0FFF ) ;
s = pBuffer ;
bytes_to_copy = 4096 - ( memoryOffset - block_address ) ;
if ( bytes_to_copy > bytesToWrite )
{
bytes_to_copy = bytesToWrite ;
}
for ( i = 0 ; i < bytes_to_copy ; i += 1 )
{
*dest++ = *s++ ;
}
memoryOffset += bytes_to_copy ;
bytesToWrite -= bytes_to_copy ;
s = Block_buffer ;
j = 0 ;
for ( i = 0 ; i < 16 ; i += 1 ) // pages in block
{
j <<= 1 ;
x = eeprom_page_erased( s ) ;
if ( x == 0 ) // Not blank
{
AT25D_Write( s, 256, block_address ) ;
j |= 1 ;
}
s += 256 ;
block_address += 256 ;
}
pMailbox->argument.outputWrite.debug1 = j ;
}
// if ((memoryOffset % pageSize) != 0) {
// /* We are not page aligned, retrieve first page content to update it*/
// if (memoryOffset < writtenAddress) {
// lastErasedBlock = 0xFFFF;
// }
// /* Flush temp buffer */
// memset((uint32_t *)tempBufferAddr, 0xFF, pageSize);
// bufferOffset = (memoryOffset % pageSize);
// packetSize = pageSize - bufferOffset;
// memoryOffset -= bufferOffset;
// /* Read page to be updated*/
// AT25D_Read( (uint8_t *) tempBufferAddr, pageSize, memoryOffset);
// /* Fill retrieved page with data to be programmed */
// memcpy((uint8_t *)(tempBufferAddr + bufferOffset), pBuffer, packetSize);
// if (((memoryOffset / blockSize) > lastErasedBlock) || (lastErasedBlock == 0xFFFF)) {
// /* Erase the block to be updated */
//// AT25D_EraseBlock( memoryOffset);
// lastErasedBlock = (memoryOffset / blockSize);
// }
// /* Write the page contents */
//// AT25D_Write( (uint8_t *) tempBufferAddr, pageSize, memoryOffset);
// bytesToWrite = (bytesToWrite > packetSize) ? (bytesToWrite - packetSize) : 0;
// pBuffer += packetSize;
// memoryOffset += pageSize;
// writtenAddress = memoryOffset;
// }
// /* If it remains more than one page to write */
// while (bytesToWrite >= pageSize)
// {
// if (memoryOffset < writtenAddress)
// {
// lastErasedBlock = 0xFFFF;
// }
// if (((memoryOffset / blockSize) > lastErasedBlock) || (lastErasedBlock == 0xFFFF)) {
// /* Erase the block to be updated */
//// AT25D_EraseBlock( memoryOffset);
// lastErasedBlock = (memoryOffset / blockSize);
// }
// /* Write the page contents */
// AT25D_Write( (uint8_t *) pBuffer, pageSize, memoryOffset);
// pBuffer += pageSize;
// memoryOffset += pageSize;
// bytesToWrite -= pageSize;
// writtenAddress = memoryOffset;
// }
// /* Write remaining data */
// if (bytesToWrite > 0) {
// /* Read previous content of page */
// AT25D_Read( (uint8_t *) tempBufferAddr, pageSize, memoryOffset);
// /* Fill retrieved block with data to be programmed */
// memcpy((uint8_t *)tempBufferAddr, pBuffer, bytesToWrite);
// if (((memoryOffset / blockSize) > lastErasedBlock) || (lastErasedBlock == 0xFFFF)) {
// /* Erase the block to be updated */
//// AT25D_EraseBlock( memoryOffset);
// lastErasedBlock = (memoryOffset / blockSize);
// }
// /* Write the page contents */;
//// AT25D_Write( (uint8_t *) tempBufferAddr, pageSize, memoryOffset);
// writtenAddress = memoryOffset + bytesToWrite;
// /* No more bytes to write */
// bytesToWrite = 0;
// }
//// TRACE_INFO("WRITE return byte written : 0x%lx Bytes\n\r",
//// pMailbox->argument.inputWrite.bufferSize - bytesToWrite);
pMailbox->argument.outputWrite.bytesWritten = pMailbox->argument.inputWrite.bufferSize - bytesToWrite;
// pMailbox->argument.outputWrite.bytesWritten = bytesToWrite;
pMailbox->status = APPLET_SUCCESS;
}
// // ----------------------------------------------------------
// // READ:
// // ----------------------------------------------------------
else if (pMailbox->command == APPLET_CMD_READ)
{
memoryOffset = pMailbox->argument.inputRead.memoryOffset;
bufferAddr = pMailbox->argument.inputRead.bufferAddr;
bytesToRead = pMailbox->argument.inputRead.bufferSize;
// TRACE_INFO("READ at offset: 0x%lx buffer at : 0x%lx of: 0x%lx Bytes\n\r",
// memoryOffset, bufferAddr, bytesToRead);
/* Check word alignment */
if (memoryOffset % 4) {
pMailbox->status = APPLET_ALIGN_ERROR;
goto exit;
}
pBuffer = (uint8_t *) bufferAddr;
/* Read packet after packets */
while (((uint32_t)pBuffer < (bufferAddr + bufferSize)) && (bytesToRead > 0))
{
packetSize = bytesToRead ;
if ( packetSize > MAX_COUNT )
{
packetSize = MAX_COUNT ;
}
AT25D_Read( pBuffer, packetSize, memoryOffset);
pBuffer += packetSize;
bytesToRead -= packetSize;
memoryOffset += packetSize;
}
// TRACE_INFO("READ return byte read : 0x%lx Bytes\n\r",
// pMailbox->argument.inputRead.bufferSize - bytesToRead);
pMailbox->argument.outputRead.bytesRead = pMailbox->argument.inputRead.bufferSize - bytesToRead;
pMailbox->status = APPLET_SUCCESS;
}
// // ----------------------------------------------------------
// // FULL ERASE:
// // ----------------------------------------------------------
else if (pMailbox->command == APPLET_CMD_FULL_ERASE)
{
pMailbox->status = APPLET_ERASE_FAIL;
// TRACE_INFO("FULL ERASE\n\r");
// unprotect_eeprom() ;
// /* Unprotected the flash */
//// if (AT25D_Unprotect(&at25)) {
//// TRACE_INFO("Can not unprotect the flash\n\r");
//// pMailbox->status = APPLET_UNPROTECT_FAIL;
//// goto exit;
//// }
// TRACE_INFO("Flash unprotected\n\r");
// /* Erase the chip */
// TRACE_INFO("Chip is being erased...\n\r");
//// if (AT25D_EraseChip()) {
// // NOT IMPLEMENTED (YET?)
// TRACE_INFO("Erasing error\n\r");
// pMailbox->status = APPLET_ERASE_FAIL;
// goto exit;
//// }
// TRACE_INFO("Full Erase achieved\n\r");
// pMailbox->status = APPLET_SUCCESS;
}
// // ----------------------------------------------------------
// // BUFFER ERASE:
// // ----------------------------------------------------------
else if (pMailbox->command == APPLET_CMD_BUFFER_ERASE)
{
// TRACE_INFO("BUFFER ERASE \n\r");
/* Unprotected the flash */
unprotect_eeprom() ;
// if (AT25D_Unprotect(&at25)) {
// TRACE_INFO("Can not unprotect the flash\n\r");
// pMailbox->status = APPLET_UNPROTECT_FAIL;
// goto exit;
// }
memoryOffset = pMailbox->argument.inputBufferErase.memoryOffset;
if (AT25D_EraseBlock( memoryOffset))
{
pMailbox->status = APPLET_ERASE_FAIL;
// TRACE_INFO("Block erasing error\n\r");
goto exit;
}
pMailbox->argument.outputBufferErase.bytesErased = 4096;
// TRACE_INFO("Buffer Erase achieved\n\r");
pMailbox->status = APPLET_SUCCESS;
}
exit:
/* Acknowledge the end of command */
// TRACE_INFO("\tEnd of applet (command : %lx --- status : %lx)\n\r", pMailbox->command, pMailbox->status);
/* Notify the host application of the end of the command processing */
pMailbox->command = ~(pMailbox->command);
/* Send ACK character */
// if (comType == DBGU_COM_TYPE)
// {
/* Wait for the transmitter to be ready */
// while ( (DBGU->DBGU_SR & DBGU_SR_TXEMPTY) == 0 ) ;
/* Send character */
// DBGU->DBGU_THR= 0x06 ;
// }
return 0;
}
@@ -1,734 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2011, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/**
* \page sam3s_ek_board_desc SAM3S-EK - Board Description
*
* \section Purpose
*
* A file is dedicated to descibe the AT91SAM3S-EK board.
*
* \section Contents
*
* - For AT91SAM3S-EK information, see \subpage sam3s_ek_board_info.
* - For operating frequency information, see \subpage sam3s_ek_opfreq.
* - For using portable PIO definitions, see \subpage sam3s_ek_piodef.
* - For on-board memories, see \subpage sam3s_ek_mem.
* - Several USB definitions are included here, see \subpage sam3s_ek_usb.
* - For External components, see \subpage sam3s_ek_extcomp.
* - For Individual chip definition, see \subpage sam3s_ek_chipdef.
*
* To get more software details and the full list of parameters related to the
* SAM3S-EK board configuration, please have a look at the source file:
* \ref board.h\n
*
* \section Usage
*
* - The code for booting the board is provided by board_cstartup_xxx.c and
* board_lowlevel.c.
* - For using board PIOs, board characteristics (clock, etc.) and external
* components, see board.h.
* - For manipulating memories, see board_memories.h.
*
* This file can be used as a template and modified to fit a custom board, with
* specific PIOs usage or memory connections.
*/
/**
* \file board.h
*
* Definition of AT91SAM3S-EK characteristics, AT91SAM3S-dependant PIOs and
* external components interfacing.
*/
#ifndef _BOARD_
#define _BOARD_
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include <chip.h>
//#include <include/at45d.h>
//#include <include/at45_spi.h>
#include <include/board_lowlevel.h>
//#include <include/board_memories.h>
//#include <include/hamming.h>
//#include <include/math.h>
//#include <include/uart_console.h>
/*----------------------------------------------------------------------------
* Definitions
*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/**
* \page sam3s_ek_board_info "SAM3S-EK - Board informations"
* This page lists several definition related to the board description.
*
* \section Definitions
* - \ref BOARD_NAME
*/
/** Name of the board */
#define BOARD_NAME "ATSAM3S-EK"
/** Board definition */
#define atsam3sek
/** Family definition (already defined) */
#define atsam3s
/** Core definition */
#define cortexm3
/*
#define BOARD_REV_A
*/
#define BOARD_REV_B
/*----------------------------------------------------------------------------*/
/**
* \page sam3s_ek_opfreq "SAM3S-EK - Operating frequencies"
* This page lists several definition related to the board operating frequency
* (when using the initialization done by board_lowlevel.c).
*
* \section Definitions
* - \ref BOARD_MAINOSC
* - \ref BOARD_MCK
*/
/** Frequency of the board main oscillator */
#define BOARD_MAINOSC 12000000
/** Master clock frequency (when using board_lowlevel.c) */
// #define BOARD_MCK 64000000
/*----------------------------------------------------------------------------*/
/**
* \page sam3s_ek_piodef "SAM3S-EK - PIO definitions"
* This pages lists all the pio definitions contained in board.h. The constants
* are named using the following convention: PIN_* for a constant which defines
* a single Pin instance (but may include several PIOs sharing the same
* controller), and PINS_* for a list of Pin instances.
*
* ADC
* - \ref PIN_ADC0_AD0
* - \ref PIN_ADC0_AD1
* - \ref PIN_ADC0_AD2
* - \ref PIN_ADC0_AD3
* - \ref PIN_ADC0_AD4
* - \ref PIN_ADC0_AD5
* - \ref PIN_ADC0_AD6
* - \ref PIN_ADC0_AD7
* - \ref PINS_ADC
*
* UART
* - \ref PINS_UART
*
* EBI
* - \ref PIN_EBI_DATA_BUS
* - \ref PIN_EBI_NRD
* - \ref PIN_EBI_NWE
* - \ref PIN_EBI_NCS0
* - \ref PIN_EBI_PSRAM_ADDR_BUS
* - \ref PIN_EBI_PSRAM_NBS
* - \ref PIN_EBI_A1
* - \ref PIN_EBI_NCS1
* - \ref PIN_EBI_LCD_RS
*
* LEDs
* - \ref PIN_LED_0
* - \ref PIN_LED_1
* - \ref PIN_LED_2
* - \ref PINS_LEDS
*
* MCI
* - \ref PINS_MCI
*
* Push buttons
* - \ref PIN_PUSHBUTTON_1
* - \ref PIN_PUSHBUTTON_2
* - \ref PINS_PUSHBUTTONS
* - \ref PUSHBUTTON_BP1
* - \ref PUSHBUTTON_BP2
*
* PWMC
* - \ref PIN_PWMC_PWMH0
* - \ref PIN_PWMC_PWML0
* - \ref PIN_PWMC_PWMH1
* - \ref PIN_PWMC_PWML1
* - \ref PIN_PWMC_PWMH2
* - \ref PIN_PWMC_PWML2
* - \ref PIN_PWMC_PWMH3
* - \ref PIN_PWMC_PWML3
* - \ref PIN_PWM_LED0
* - \ref PIN_PWM_LED1
* - \ref PIN_PWM_LED2
* - \ref CHANNEL_PWM_LED0
* - \ref CHANNEL_PWM_LED1
* - \ref CHANNEL_PWM_LED2
*
* SPI
* - \ref PIN_SPI_MISO
* - \ref PIN_SPI_MOSI
* - \ref PIN_SPI_SPCK
* - \ref PINS_SPI
* - \ref PIN_SPI_NPCS0_PA11
*
* SSC
* - \ref PIN_SSC_TD
* - \ref PIN_SSC_TK
* - \ref PIN_SSC_TF
* - \ref PINS_SSC_CODEC
*
* PCK0
* - \ref PIN_PCK0
*
* PIO PARALLEL CAPTURE
* - \ref PIN_PIODCEN1
* - \ref PIN_PIODCEN2
*
* TWI
* - \ref TWI_V3XX
* - \ref PIN_TWI_TWD0
* - \ref PIN_TWI_TWCK0
* - \ref PINS_TWI0
* - \ref PIN_TWI_TWD1
* - \ref PIN_TWI_TWCK1
* - \ref PINS_TWI1
*
* USART0
* - \ref PIN_USART0_RXD
* - \ref PIN_USART0_TXD
* - \ref PIN_USART0_CTS
* - \ref PIN_USART0_RTS
* - \ref PIN_USART0_SCK
*
* USB
* - \ref PIN_USB_VBUS
*
* NandFlash
* - \ref PIN_EBI_NANDOE
* - \ref PIN_EBI_NANDWE
* - \ref PIN_EBI_NANDCLE
* - \ref PIN_EBI_NANDALE
* - \ref PIN_EBI_NANDIO
* - \ref BOARD_NF_CE_PIN
* - \ref BOARD_NF_RB_PIN
* - \ref PINS_NANDFLASH
*
* QTouch
* PIO definitions for Slider
* \ref SLIDER_IOMASK_SNS
* \ref SLIDER_IOMASK_SNSK
* \ref PINS_SLIDER_SNS
* \ref PINS_SLIDER_SNSK
*
* PIO definitions for keys
* \ref KEY_IOMASK_SNS
* \ref KEY_IOMASK_SNSK
* \ref PINS_KEY_SNS
* \ref PINS_KEY_SNSK
*
* PIOS for QTouch
* \ref PINS_QTOUCH
*/
/** ADC_AD0 pin definition. */
#define PIN_ADC0_AD0 {1 << 21, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
/** ADC_AD1 pin definition. */
#define PIN_ADC0_AD1 {1 << 30, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
/** ADC_AD2 pin definition. */
#define PIN_ADC0_AD2 {1 << 3, PIOB, ID_PIOB, PIO_INPUT, PIO_DEFAULT}
/** ADC_AD3 pin definition. */
#define PIN_ADC0_AD3 {1 << 4, PIOB, ID_PIOB, PIO_INPUT, PIO_DEFAULT}
/** ADC_AD4 pin definition. */
#define PIN_ADC0_AD4 {1 << 15, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
/** ADC_AD5 pin definition. */
#define PIN_ADC0_AD5 {1 << 16, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
/** ADC_AD6 pin definition. */
#define PIN_ADC0_AD6 {1 << 17, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
/** ADC_AD7 pin definition. */
#define PIN_ADC0_AD7 {1 << 18, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
/** Pins ADC */
#define PINS_ADC PIN_ADC0_AD0, PIN_ADC0_AD1, PIN_ADC0_AD2, PIN_ADC0_AD3, PIN_ADC0_AD4, PIN_ADC0_AD5, PIN_ADC0_AD6, PIN_ADC0_AD7
/** Startup time max, return from Idle mode (in µs) */
#define ADC_STARTUP_TIME_MAX 15
/** Track and hold Acquisition Time min (in ns) */
#define ADC_TRACK_HOLD_TIME_MIN 1200
/** ADC clock frequence */
#define BOARD_ADC_FREQ (6000000)
/** UART pins (UTXD0 and URXD0) definitions, PA9,10. */
#define PINS_UART {0x00000600, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** EBI Data Bus pins */
#define PIN_EBI_DATA_BUS {0xFF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** EBI NRD pin */
#define PIN_EBI_NRD {1 << 11, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** EBI NWE pin */
#define PIN_EBI_NWE {1 << 8, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** EBI NCS0 pin */
#define PIN_EBI_NCS0 {1 << 20, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_PULLUP}
/** EBI pins for PSRAM address bus */
#define PIN_EBI_PSRAM_ADDR_BUS {0x3f00fff, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** EBI pins for PSRAM NBS pins */
#define PIN_EBI_PSRAM_NBS {1 << 7, PIOB, ID_PIOB, PIO_PERIPH_B, PIO_PULLUP}, \
{1 << 15, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** EBI A1 pin */
#define PIN_EBI_A1 {1 << 19, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** EBI NCS1 pin */
#define PIN_EBI_NCS1 {1 << 15, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP} /* LCD CS pin */
/** EBI pin for LCD RS */
#define PIN_EBI_LCD_RS {1 << 19, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP} /* LCD RS pin */
#define LED_BLUE 0
#define LED_GREEN 1
#define LED_RED 2
#ifdef BOARD_REV_A
/** LED #0 pin definition (BLUE). */
#define PIN_LED_0 {PIO_PC20, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
/** LED #1 pin definition (GREEN). */
#define PIN_LED_1 {PIO_PC21, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
/** LED #2 pin definition (RED). */
#define PIN_LED_2 {PIO_PC22, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
#endif
#ifdef BOARD_REV_B
/** LED #0 pin definition (BLUE). */
#define PIN_LED_0 {PIO_PA19, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
/** LED #1 pin definition (GREEN). */
#define PIN_LED_1 {PIO_PA20, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT}
/** LED #2 pin definition (RED). */
#define PIN_LED_2 {PIO_PC20, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
#endif
/** List of all LEDs definitions. */
#define PINS_LEDS PIN_LED_0, PIN_LED_1, PIN_LED_2
/** MCI pins definition. */
#define PINS_MCI {0x3fUL << 26, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP}
/** MCI pin Card Detect. */
#ifdef BOARD_REV_A
#define PIN_MCI_CD {PIO_PA15, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
#endif
#ifdef BOARD_REV_B
#define PIN_MCI_CD {PIO_PA6, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
#endif
/** Push button #0 definition. Attributes = pull-up + debounce + interrupt on rising edge. */
#define PIN_PUSHBUTTON_1 {PIO_PB3, PIOB, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_RISE_EDGE}
/** Push button #1 definition. Attributes = pull-up + debounce + interrupt on falling edge. */
#define PIN_PUSHBUTTON_2 {PIO_PC12, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE}
/** List of all push button definitions. */
#define PINS_PUSHBUTTONS PIN_PUSHBUTTON_1, PIN_PUSHBUTTON_2
/** Push button #1 index. */
#define PUSHBUTTON_BP1 0
/** Push button #2 index. */
#define PUSHBUTTON_BP2 1
/** Simulated joystick LEFT index. */
#define JOYSTICK_LEFT 0
/** Simulated joystick RIGHT index. */
#define JOYSTICK_RIGHT 1
/** PWMC PWM0 pin definition: Output High. */
#define PIN_PWMC_PWMH0 {PIO_PC18B_PWMH0, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
/** PWMC PWM0 pin definition: Output Low. */
#define PIN_PWMC_PWML0 {PIO_PA19B_PWML0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
/** PWMC PWM1 pin definition: Output High. */
#define PIN_PWMC_PWMH1 {PIO_PC19B_PWMH1, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
/** PWMC PWM1 pin definition: Output Low. */
#define PIN_PWMC_PWML1 {PIO_PA20B_PWML1, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
/** PWMC PWM2 pin definition: Output High. */
#define PIN_PWMC_PWMH2 {PIO_PC20B_PWMH2, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
/** PWMC PWM2 pin definition: Output Low. */
#define PIN_PWMC_PWML2 {PIO_PA16C_PWML2, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}
/** PWMC PWM3 pin definition: Output High. */
#define PIN_PWMC_PWMH3 {PIO_PC21B_PWMH3, PIOC, ID_PIOC, PIO_PERIPH_B, PIO_DEFAULT}
/** PWMC PWM3 pin definition: Output Low. */
#define PIN_PWMC_PWML3 {PIO_PA15C_PWML3, PIOA, ID_PIOA, PIO_PERIPH_C, PIO_DEFAULT}
/** PWM pins definition for LED0 */
#define PIN_PWM_LED0 PIN_PWMC_PWMH0, PIN_PWMC_PWML0
/** PWM pins definition for LED1 */
#define PIN_PWM_LED1 PIN_PWMC_PWMH1, PIN_PWMC_PWML1
/** PWM pins definition for LED2 */
#define PIN_PWM_LED2 PIN_PWMC_PWMH2, PIN_PWMC_PWML2
/** PWM channel for LED0 */
#define CHANNEL_PWM_LED0 0
/** PWM channel for LED1 */
#define CHANNEL_PWM_LED1 1
/** PWM channel for LED2 */
#define CHANNEL_PWM_LED2 2
/** SPI MISO pin definition. */
#define PIN_SPI_MISO {PIO_PA12A_MISO, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** SPI MOSI pin definition. */
#define PIN_SPI_MOSI {PIO_PA13A_MOSI, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** SPI SPCK pin definition. */
#define PIN_SPI_SPCK {PIO_PA14A_SPCK, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** SPI chip select pin definition. */
#define PIN_SPI_NPCS0_PA11 {PIO_PA11A_NPCS0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** List of SPI pin definitions (MISO, MOSI & SPCK). */
#define PINS_SPI PIN_SPI_MISO, PIN_SPI_MOSI, PIN_SPI_SPCK
/** SSC pin Transmitter Data (TD) */
#define PIN_SSC_TD {PIO_PA17A_TD, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** SSC pin Transmitter Clock (TK) */
#define PIN_SSC_TK {PIO_PA16A_TK, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** SSC pin Transmitter FrameSync (TF) */
#define PIN_SSC_TF {PIO_PA15A_TF, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** SSC pins definition for codec. */
#define PINS_SSC_CODEC PIN_SSC_TD, PIN_SSC_TK, PIN_SSC_TF
/** PCK0 */
#define PIN_PCK0 {PIO_PA6B_PCK0, PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
#define PIN_PCK1 {PIO_PA17B_PCK1,PIOA, ID_PIOA, PIO_PERIPH_B, PIO_DEFAULT}
/** PIO PARALLEL CAPTURE */
/** Parallel Capture Mode Data Enable1 */
#define PIN_PIODCEN1 PIO_PA15
/** Parallel Capture Mode Data Enable2 */
#define PIN_PIODCEN2 PIO_PA16
/** TWI ver 3.xx */
#define TWI_V3XX
/** TWI0 data pin */
#define PIN_TWI_TWD0 {PIO_PA3A_TWD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** TWI0 clock pin */
#define PIN_TWI_TWCK0 {PIO_PA4A_TWCK0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** TWI0 pins */
#define PINS_TWI0 PIN_TWI_TWD0, PIN_TWI_TWCK0
/** TWI1 data pin */
#define PIN_TWI_TWD1 {PIO_PB4A_TWD1, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
/** TWI1 clock pin */
#define PIN_TWI_TWCK1 {PIO_PB5A_TWCK1, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
/** TWI1 pins */
#define PINS_TWI1 PIN_TWI_TWD1, PIN_TWI_TWCK1
/** USART0 pin RX */
#define PIN_USART0_RXD {PIO_PA5A_RXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** USART0 pin TX */
#define PIN_USART0_TXD {PIO_PA6A_TXD0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** USART0 pin CTS */
#define PIN_USART0_CTS {PIO_PA8A_CTS0, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
/** USART0 pin RTS */
#define PIN_USART0_RTS {PIO_PA7A_RTS0, PIOB, ID_PIOB, PIO_PERIPH_A, PIO_DEFAULT}
/** USART0 pin SCK */
#define PIN_USART0_SCK {PIO_PA2B_SCK0, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** USART1 pin RX */
#define PIN_USART1_RXD {PIO_PA21A_RXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** USART1 pin TX */
#define PIN_USART1_TXD {PIO_PA22A_TXD1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** USART1 pin CTS */
#define PIN_USART1_CTS {PIO_PA25A_CTS1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** USART1 pin RTS */
#define PIN_USART1_RTS {PIO_PA24A_RTS1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** USART1 pin ENABLE */
#define PIN_USART1_EN {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
/** USART1 pin SCK */
#define PIN_USART1_SCK {PIO_PA23A_SCK1, PIOA, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT}
/** USB VBus monitoring pin definition. */
#ifdef BOARD_REV_A
#define PIN_USB_VBUS {PIO_PC23, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP}
#endif
#ifdef BOARD_REV_B
#define PIN_USB_VBUS {PIO_PC21, PIOC, ID_PIOC, PIO_INPUT, PIO_PULLUP}
#endif
/** NandFlash pins definition: OE. */
#define PIN_EBI_NANDOE {PIO_PC9, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** NandFlash pins definition: WE. */
#define PIN_EBI_NANDWE {PIO_PC10, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** NandFlash pins definition: CLE. */
#define PIN_EBI_NANDCLE {PIO_PC17, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** NandFlash pins definition: ALE. */
#define PIN_EBI_NANDALE {PIO_PC16, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** NandFlash pins definition: DATA. */
#define PIN_EBI_NANDIO {0x000000FF, PIOC, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP}
/** Nandflash chip enable pin definition. */
#define BOARD_NF_CE_PIN {PIO_PC14, PIOC, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT}
/** Nandflash controller peripheral pins definition. */
#define PINS_NANDFLASH PIN_EBI_NANDIO, BOARD_NF_CE_PIN, PIN_EBI_NANDOE, \
PIN_EBI_NANDWE, PIN_EBI_NANDCLE, PIN_EBI_NANDALE
/* PIO definitions for Slider */
#define SLIDER_IOMASK_SNS (uint32_t)(PIO_PA0 | PIO_PA2 | PIO_PA4)
#define SLIDER_IOMASK_SNSK (uint32_t)(PIO_PA1 | PIO_PA3 | PIO_PA5)
#define PINS_SLIDER_SNS {SLIDER_IOMASK_SNS, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
#define PINS_SLIDER_SNSK {SLIDER_IOMASK_SNSK, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
/* PIO definitions for keys */
#define KEY_IOMASK_SNS (uint32_t)(PIO_PC22 | PIO_PC24 | PIO_PC26 | PIO_PC28 | PIO_PC30)
#define KEY_IOMASK_SNSK (uint32_t)(PIO_PC23 | PIO_PC25 | PIO_PC27 | PIO_PC29 | PIO_PC31)
#define PINS_KEY_SNS {KEY_IOMASK_SNS, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
#define PINS_KEY_SNSK {KEY_IOMASK_SNSK, PIOC, ID_PIOC, PIO_INPUT, PIO_DEFAULT}
/* PIOS for QTouch */
#define PINS_QTOUCH PINS_SLIDER_SNS, PINS_SLIDER_SNSK, PINS_KEY_SNS, PINS_KEY_SNSK
/*----------------------------------------------------------------------------*/
/**
* \page sam3s_ek_usb "SAM3S-EK - USB device"
*
* \section Definitions
* - \ref BOARD_USB_BMATTRIBUTES
* - \ref CHIP_USB_UDP
* - \ref CHIP_USB_PULLUP_INTERNAL
* - \ref CHIP_USB_NUMENDPOINTS
* - \ref CHIP_USB_ENDPOINTS_MAXPACKETSIZE
* - \ref CHIP_USB_ENDPOINTS_BANKS
*/
/** USB attributes configuration descriptor (bus or self powered, remote wakeup) */
#define BOARD_USB_BMATTRIBUTES USBConfigurationDescriptor_SELFPOWERED_RWAKEUP
/** Indicates chip has an UDP Full Speed. */
#define CHIP_USB_UDP
/** Indicates chip has an internal pull-up. */
#define CHIP_USB_PULLUP_INTERNAL
/** Number of USB endpoints */
#define CHIP_USB_NUMENDPOINTS 8
/** Endpoints max paxcket size */
#define CHIP_USB_ENDPOINTS_MAXPACKETSIZE(i) \
((i == 0) ? 64 : \
((i == 1) ? 64 : \
((i == 2) ? 64 : \
((i == 3) ? 64 : \
((i == 4) ? 512 : \
((i == 5) ? 512 : \
((i == 6) ? 64 : \
((i == 7) ? 64 : 0 ))))))))
/** Endpoints Number of Bank */
#define CHIP_USB_ENDPOINTS_BANKS(i) \
((i == 0) ? 1 : \
((i == 1) ? 2 : \
((i == 2) ? 2 : \
((i == 3) ? 1 : \
((i == 4) ? 2 : \
((i == 5) ? 2 : \
((i == 6) ? 2 : \
((i == 7) ? 2 : 0 ))))))))
/*----------------------------------------------------------------------------*/
/**
* \page sam3s_ek_extcomp "SAM3S-EK - External components"
* This page lists the definitions related to external on-board components
* located in the board.h file for the AT91SAM3S-EK.
*
* SD Card
* - \ref BOARD_SD_PINS
* - \ref BOARD_SD_PIN_CD
*
* LCD
* - \ref BOARD_LCD_ILI9325
* - \ref BOARD_LCD_PINS
* - \ref BOARD_BACKLIGHT_PIN
* - \ref BOARD_LCD_BASE
* - \ref BOARD_LCD_RS
* - \ref BOARD_LCD_WIDTH
* - \ref BOARD_LCD_HEIGHT
*
* TouchScreen
* - \ref BOARD_TSC_ADS7843
* - \ref PIN_TCS_IRQ
* - \ref PIN_TCS_BUSY
* - \ref BOARD_TSC_SPI_BASE
* - \ref BOARD_TSC_SPI_ID
* - \ref BOARD_TSC_SPI_PINS
* - \ref BOARD_TSC_NPCS
* - \ref BOARD_TSC_NPCS_PIN
*
* SmartCard
* - \ref SMARTCARD_CONNECT_PIN
* - \ref PIN_ISO7816_RSTMC
* - \ref PINS_ISO7816
*/
/** MCI pins that shall be configured to access the SD card. */
#define BOARD_SD_PINS PINS_MCI
/** MCI Card Detect pin. */
#define BOARD_SD_PIN_CD PIN_MCI_CD
/** Indicates board has an ILI9325 external component to manage LCD. */
#define BOARD_LCD_ILI9325
/** LCD pins definition. */
#define BOARD_LCD_PINS PIN_EBI_DATA_BUS, PIN_EBI_NRD, PIN_EBI_NWE, PIN_EBI_NCS1, PIN_EBI_LCD_RS
/** Backlight pin definition. */
#define BOARD_BACKLIGHT_PIN {PIO_PC13, PIOC, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT}
/** Define ILI9325 base address. */
#define BOARD_LCD_BASE 0x61000000
/** Define ILI9325 register select signal. */
#define BOARD_LCD_RS (1 << 1)
/** Display width in pixels. */
#define BOARD_LCD_WIDTH 240
/** Display height in pixels. */
#define BOARD_LCD_HEIGHT 320
/** Indicates board has an ADS7843 external component to manage Touch Screen */
#define BOARD_TSC_ADS7843
/** Touchscreen controller IRQ pin definition. */
#ifdef BOARD_REV_A
#define PIN_TSC_IRQ {PIO_PA4, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
#define PIN_TSC_IRQ_WUP_ID (1 << 3)
/** Touchscreen controller Busy pin definition. */
#define PIN_TSC_BUSY {PIO_PA5, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
#endif
#ifdef BOARD_REV_B
#define PIN_TSC_IRQ {PIO_PA16, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
#define PIN_TSC_IRQ_WUP_ID (1 << 15)
/** Touchscreen controller Busy pin definition. */
#define PIN_TSC_BUSY {PIO_PA17, PIOA, ID_PIOA, PIO_INPUT, PIO_PULLUP}
#endif
/** Base address of SPI peripheral connected to the touchscreen controller. */
#define BOARD_TSC_SPI_BASE SPI
/** Identifier of SPI peripheral connected to the touchscreen controller. */
#define BOARD_TSC_SPI_ID ID_SPI
/** Pins of the SPI peripheral connected to the touchscreen controller. */
#define BOARD_TSC_SPI_PINS PINS_SPI
/** Chip select connected to the touchscreen controller. */
#define BOARD_TSC_NPCS 0
/** Chip select pin connected to the touchscreen controller. */
#define BOARD_TSC_NPCS_PIN PIN_SPI_NPCS0_PA11
/// Smartcard detection pin
//#define SMARTCARD_CONNECT_PIN {1 << 13, PIOA, ID_PIOA, PIO_INPUT, PIO_DEFAULT}
/// PIN used for reset the smartcard
#define PIN_ISO7816_RSTMC {1 << 11, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT}
/// Pins used for connect the smartcard
#define PINS_ISO7816 PIN_USART1_TXD, PIN_USART1_SCK, PIN_ISO7816_RSTMC
/*----------------------------------------------------------------------------*/
/**
* \page sam3s_ek_mem "SAM3S-EK - Memories"
* This page lists definitions related to internal & external on-board memories.
*
* \section SRAM
* - \ref AT91C_ISRAM
* - \ref AT91C_ISRAM_SIZE
*
* \section Flash
* - \ref AT91C_IFLASH_SIZE
* - \ref AT91C_IFLASH_PAGE_SIZE
* - \ref AT91C_IFLASH_NB_OF_PAGES
* - \ref AT91C_IFLASH_LOCK_REGION_SIZE
* - \ref AT91C_IFLASH_NB_OF_LOCK_BITS
*
* \section NandFlash
* - \ref BOARD_NF_COMMAND_ADDR
* - \ref BOARD_NF_ADDRESS_ADDR
* - \ref BOARD_NF_DATA_ADDR
*
* \section NorFlash
* - \ref BOARD_NORFLASH_ADDR
* - \ref BOARD_NORFLASH_DFT_BUS_SIZE
*/
/** Address for transferring command bytes to the nandflash. */
#define BOARD_NF_COMMAND_ADDR 0x60400000
/** Address for transferring address bytes to the nandflash. */
#define BOARD_NF_ADDRESS_ADDR 0x60200000
/** Address for transferring data bytes to the nandflash. */
#define BOARD_NF_DATA_ADDR 0x60000000
/** Address for transferring command bytes to the norflash. */
#define BOARD_NORFLASH_ADDR 0x63000000
/** Default NOR bus size after power up reset */
#define BOARD_NORFLASH_DFT_BUS_SIZE 8
/*----------------------------------------------------------------------------*/
/**
* \page sam3s_ek_chipdef "SAM3S-EK - Individual chip definition"
* This page lists the definitions related to different chip's definition
* located in the board.h file for the SAM3S-EK.
*
* \section USART
* - \ref BOARD_PIN_USART_RXD
* - \ref BOARD_PIN_USART_TXD
* - \ref BOARD_PIN_USART_CTS
* - \ref BOARD_PIN_USART_RTS
* - \ref BOARD_PIN_USART_EN
* - \ref BOARD_USART_BASE
* - \ref BOARD_ID_USART
*/
/** Rtc */
#define BOARD_RTC_ID ID_RTC
/** TWI ID for EEPROM application to use */
#define BOARD_ID_TWI_EEPROM ID_TWI1
/** TWI ID for SLAVE application to use */
#define BOARD_ID_TWI_SLAVE ID_TWI1
/** TWI Base for TWI EEPROM application to use */
#define BOARD_BASE_TWI_EEPROM TWI1
/** TWI Base for TWI SLAVE application to use */
#define BOARD_BASE_TWI_SLAVE TWI1
/** TWI pins for EEPROM application to use */
#define BOARD_PINS_TWI_EEPROM PINS_TWI1
/** TWI pins for TWI SLAVE application to use */
#define BOARD_PINS_TWI_SLAVE PINS_TWI1
/** USART RX pin for application */
#define BOARD_PIN_USART_RXD PIN_USART1_RXD
/** USART TX pin for application */
#define BOARD_PIN_USART_TXD PIN_USART1_TXD
/** USART CTS pin for application */
#define BOARD_PIN_USART_CTS PIN_USART1_CTS
/** USART RTS pin for application */
#define BOARD_PIN_USART_RTS PIN_USART1_RTS
/** USART ENABLE pin for application */
#define BOARD_PIN_USART_EN PIN_USART1_EN
/** USART Base for application */
#define BOARD_USART_BASE USART1
/** USART ID for application */
#define BOARD_ID_USART ID_USART1
#endif /* #ifndef _BOARD_ */
@@ -1,46 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/**
* \file
*
* Interface for the low-level initialization function.
*
*/
#ifndef BOARD_LOWLEVEL_H
#define BOARD_LOWLEVEL_H
/*----------------------------------------------------------------------------
* Exported functions
*----------------------------------------------------------------------------*/
extern void LowLevelInit( void ) ;
#endif /* BOARD_LOWLEVEL_H */
@@ -1,81 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/*------------------------------------------------------------------------------
* Linker script for running in internal SRAM on the AT91SAM3S1
*----------------------------------------------------------------------------*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(ResetException)
/* Memory Spaces Definitions */
MEMORY
{
sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x00004000 /* sram, 16K */
}
SECTIONS
{
.fixed :
{
. = ALIGN(4);
_sfixed = .;
KEEP(*(.vectors))
*(.text*)
*(.ramfunc)
*(.rodata*)
*(.glue_7)
*(.glue_7t)
. = ALIGN(4);
_efixed = .; /* End of text section */
} > sram
.relocate : AT (_efixed)
{
. = ALIGN(4);
_srelocate = .;
*(.data)
. = ALIGN(4);
_erelocate = .;
} >sram
.bss (NOLOAD) : {
. = ALIGN(4);
_szero = .;
*(.bss)
. = ALIGN(4);
_ezero = .;
} >sram
/* Stack in the end of SRAM */
_estack = 0x20003FFC;
}
end = .;
@@ -1,91 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/*------------------------------------------------------------------------------
* Linker script for running in internal SRAM on the AT91SAM3S1
*----------------------------------------------------------------------------*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(entry)
/* Memory Spaces Definitions */
MEMORY
{
romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x0800
sram (W!RX) : ORIGIN = 0x20000800, LENGTH = 0x00003800 /* sram, 16K - sizeof(romcodesram) */
}
/* Entry point */
/*ENTRY (ResetException)*/
SECTIONS
{
/* startup code in the .isr_vector */
.text :
{
. = ALIGN(4);
_stext = .;
KEEP(*(.isr_vector .isr_vector.*))
*(.mailbox)
*(.text .text.*)
*(.rodata .rodata.*)
*(.glue_7)
*(.glue_7t)
*(.gcc_except_table)
*(.rodata .rodata*)
*(.gnu.linkonce.r.*)
. = ALIGN(4);
_etext = .;
} > sram
/* data */
.data :
{
. = ALIGN(4);
_sidata = .;
_sdata = .;
*(.data)
*(.data.*)
. = ALIGN(4);
_edata = .;
} > sram
.bss (NOLOAD) : {
_szero = .;
*(.bss)
. = ALIGN(4);
_ezero = .;
} >sram
/* Stack in SRAM */
_sstack = 0x20003FFC;
}
end = .;
@@ -1,81 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/*------------------------------------------------------------------------------
* Linker script for running in internal SRAM on the AT91SAM3S2
*----------------------------------------------------------------------------*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(ResetException)
/* Memory Spaces Definitions */
MEMORY
{
sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x00008000 /* sram, 32K */
}
SECTIONS
{
.fixed :
{
. = ALIGN(4);
_sfixed = .;
KEEP(*(.vectors))
*(.text*)
*(.ramfunc)
*(.rodata*)
*(.glue_7)
*(.glue_7t)
. = ALIGN(4);
_efixed = .; /* End of text section */
} > sram
.relocate : AT (_efixed)
{
. = ALIGN(4);
_srelocate = .;
*(.data)
. = ALIGN(4);
_erelocate = .;
} >sram
.bss (NOLOAD) : {
. = ALIGN(4);
_szero = .;
*(.bss)
. = ALIGN(4);
_ezero = .;
} >sram
/* Stack in the end of SRAM */
_estack = 0x20007FFC;
}
end = .;
@@ -1,91 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/*------------------------------------------------------------------------------
* Linker script for running in internal SRAM on the AT91SAM3S2
*----------------------------------------------------------------------------*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(entry)
/* Memory Spaces Definitions */
MEMORY
{
romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x0800
sram (W!RX) : ORIGIN = 0x20000800, LENGTH = 0x00007800 /* sram, 32K - sizeof(romcodesram) */
}
/* Entry point */
/*ENTRY (ResetException)*/
SECTIONS
{
/* startup code in the .isr_vector */
.text :
{
. = ALIGN(4);
_stext = .;
KEEP(*(.isr_vector .isr_vector.*))
*(.mailbox)
*(.text .text.*)
*(.rodata .rodata.*)
*(.glue_7)
*(.glue_7t)
*(.gcc_except_table)
*(.rodata .rodata*)
*(.gnu.linkonce.r.*)
. = ALIGN(4);
_etext = .;
} > sram
/* data */
.data :
{
. = ALIGN(4);
_sidata = .;
_sdata = .;
*(.data)
*(.data.*)
. = ALIGN(4);
_edata = .;
} > sram
.bss (NOLOAD) : {
_szero = .;
*(.bss)
. = ALIGN(4);
_ezero = .;
} >sram
/* Stack in SRAM */
_sstack = 0x20007FFC;
}
end = .;
@@ -1,215 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/*------------------------------------------------------------------------------
* Linker script for running in internal SRAM on the AT91SAM3S4
*----------------------------------------------------------------------------*/
OUTPUT_FORMAT ("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
ENTRY(_start)
SEARCH_DIR(.)
GROUP(-lgcc -lc -lcs3 -lcs3unhosted -lcs3micro)
/* Memory Spaces Definitions */
MEMORY
{
sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x0000C000 /* sram, 48K */
}
/* These force the linker to search for particular symbols from
* the start of the link process and thus ensure the user's
* overrides are picked up
*/
EXTERN(__cs3_reset_generic_m)
INCLUDE atsam3s.inc
EXTERN(__cs3_interrupt_vector_micro)
EXTERN(__cs3_start_c main __cs3_stack __cs3_heap_end)
PROVIDE(__cs3_heap_start = _end);
PROVIDE(__cs3_heap_end = __cs3_region_start_ram + __cs3_region_size_ram);
PROVIDE(__cs3_region_num = (__cs3_regions_end - __cs3_regions) / 20);
PROVIDE(__cs3_stack = __cs3_region_start_ram + __cs3_region_size_ram);
SECTIONS
{
.text :
{
CREATE_OBJECT_SYMBOLS
__cs3_region_start_ram = .;
*(.cs3.region-head.ram)
ASSERT (. == __cs3_region_start_ram, ".cs3.region-head.ram not permitted");
__cs3_interrupt_vector = __cs3_interrupt_vector_micro;
*(.cs3.interrupt_vector)
/* Make sure we pulled in an interrupt vector. */
ASSERT (. != __cs3_interrupt_vector_micro, "No interrupt vector");
_start = __cs3_reset_generic_m;
__cs3_reset = __cs3_reset_generic_m;
*(.cs3.reset)
/* Make sure we pulled in some reset code. */
ASSERT (. != __cs3_reset, "No reset code");
*(.text .text.* .gnu.linkonce.t.*)
*(.plt)
*(.gnu.warning)
*(.glue_7t) *(.glue_7) *(.vfp11_veneer)
*(.ARM.extab* .gnu.linkonce.armextab.*)
*(.gcc_except_table)
} >ram
.eh_frame_hdr : ALIGN (4)
{
KEEP (*(.eh_frame_hdr))
} >ram
.eh_frame : ALIGN (4)
{
KEEP (*(.eh_frame))
} >ram
/* .ARM.exidx is sorted, so has to go in its own output section. */
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
} >ram
__exidx_end = .;
.rodata : ALIGN (4)
{
*(.rodata .rodata.* .gnu.linkonce.r.*)
. = ALIGN(4);
KEEP(*(.init))
. = ALIGN(4);
__preinit_array_start = .;
KEEP (*(.preinit_array))
__preinit_array_end = .;
. = ALIGN(4);
__init_array_start = .;
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
__init_array_end = .;
. = ALIGN(4);
KEEP(*(.fini))
. = ALIGN(4);
__fini_array_start = .;
KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
__fini_array_end = .;
. = ALIGN(0x4);
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*crtend.o(.ctors))
. = ALIGN(0x4);
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*crtend.o(.dtors))
. = ALIGN(4);
__cs3_regions = .;
LONG (0)
LONG (__cs3_region_init_ram)
LONG (__cs3_region_start_ram)
LONG (__cs3_region_init_size_ram)
LONG (__cs3_region_zero_size_ram)
__cs3_regions_end = .;
. = ALIGN (8);
_etext = .;
} >ram
.data : ALIGN (8)
{
KEEP(*(.jcr))
*(.got.plt) *(.got)
*(.shdata)
*(.data .data.* .gnu.linkonce.d.*)
. = ALIGN (8);
*(.ram)
_edata = .;
} >ram
.bss :
{
*(.shbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
. = ALIGN (8);
*(.ram.b)
_end = .;
__end = .;
} >ram
__cs3_region_init_ram = __cs3_region_start_ram;
__cs3_region_init_size_ram = _edata - __cs3_region_start_ram;
__cs3_region_zero_size_ram = _end - _edata;
/* Default to 1M of heap */
__cs3_region_size_ram = ALIGN (1024) - __cs3_region_start_ram + 1M;
.stab 0 (NOLOAD) : { *(.stab) }
.stabstr 0 (NOLOAD) : { *(.stabstr) }
/* DWARF debug sections.
* Symbols in the DWARF debugging sections are relative to the beginning
* of the section so we begin them at 0. */
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
/* DWARF 2.1 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
.note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
.ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
/DISCARD/ : { *(.note.GNU-stack) }
}
/* checksum: 576d003e2604ff7a1b02791267 */
@@ -1,91 +0,0 @@
/* ----------------------------------------------------------------------------
* ATMEL Microcontroller Software Support
* ----------------------------------------------------------------------------
* Copyright (c) 2009, Atmel Corporation
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the disclaimer below.
*
* Atmel's name may not be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ----------------------------------------------------------------------------
*/
/*------------------------------------------------------------------------------
* Linker script for running in internal SRAM on the AT91SAM3S4
*----------------------------------------------------------------------------*/
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(entry)
/* Memory Spaces Definitions */
MEMORY
{
romcodesram (W!RX) : ORIGIN = 0x20000000, LENGTH = 0x01000
sram (W!RX) : ORIGIN = 0x20001000, LENGTH = 0x0000B000 /* sram, 48K - sizeof(romcodesram) */
}
/* Entry point */
/*ENTRY (ResetException)*/
SECTIONS
{
/* startup code in the .isr_vector */
.text :
{
. = ALIGN(4);
_stext = .;
KEEP(*(.isr_vector .isr_vector.*))
*(.mailbox)
*(.text .text.*)
*(.rodata .rodata.*)
*(.glue_7)
*(.glue_7t)
*(.gcc_except_table)
*(.rodata .rodata*)
*(.gnu.linkonce.r.*)
. = ALIGN(4);
_etext = .;
} > sram
/* data */
.data :
{
. = ALIGN(4);
_sidata = .;
_sdata = .;
*(.data)
*(.data.*)
. = ALIGN(4);
_edata = .;
} > sram
.bss (NOLOAD) : {
_szero = .;
*(.bss)
. = ALIGN(4);
_ezero = .;
} >sram
/* Stack in SRAM */
_sstack = 0x2000BFFC;
}
end = .;
-63
View File
@@ -1,63 +0,0 @@
#ifndef _LIB_ATSAM3S_
#define _LIB_ATSAM3S_
/*
* Peripherals registers definitions
*/
#if defined atsam3s4
#include <include/ATSAM3S4.h>
#elif defined atsam3s2
#include <include/ATSAM3S2.h>
#elif defined atsam3s1
#include <include/ATSAM3S1.h>
#else
#warning Library does not support the specified chip, specifying atsam3s4.
#define atsam3s4
#include <include/ATSAM3S4.h>
#endif
/* Define attribute */
#if defined ( __CC_ARM ) /* Keil µVision 4 */
#define WEAK __attribute__ ((weak))
#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
#define WEAK __weak
#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */
#define WEAK __attribute__ ((weak))
#endif
/* Define NO_INIT attribute */
#if defined ( __CC_ARM )
#define NO_INIT
#elif defined ( __ICCARM__ )
#define NO_INIT __no_init
#elif defined ( __GNUC__ )
#define NO_INIT
#endif
/*
* Core
*/
/*
* Peripherals
*/
//#include <include/async.h>
//#include <include/efc.h>
//#include <include/flashd.h>
//#include <include/pio.h>
//#include <include/pmc.h>
//#include <include/spi.h>
//#include <include/spi_pdc.h>
//#include <include/twi.h>
//#include <include/twid.h>
//#include <include/usart.h>
/*
#include <USBD_Config.h>
*/
//#include <include/trace.h>
//#include <include/wdt.h>
#endif /* _LIB_ATSAM3S_ */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+66 -29
View File
@@ -63,6 +63,10 @@ PCBREV =
# Values = STD, FRSKY, JETI, NMEA, ARDUPILOT, MAVLINK, TELEMETREZ
EXT = STD
# FAI mode
# Values = YES, NO, CHOICE
FAI = NO
# Enable heli menu
# Values = YES, NO
HELI = NO
@@ -71,12 +75,13 @@ HELI = NO
# Values = YES, NO
TEMPLATES = YES
# Enable navigation with Pots / Rotary encoders
# Enable navigation with Pots / Sticks / Rotary encoders
# Values = NO
# POT1 (only POT1 available for fields modification),
# POT2 (menus scroll),
# POT3 (cursor down/up),
# POTS (POT1, POT2, POT3),
# STICKS
# ROTENC (Rotary encoder)
NAVIGATION = NO
@@ -328,7 +333,7 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
EXTRABOARDSRC = targets/stock/lcd_driver.cpp
EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp
PULSESSRC = protocols/pulses_avr.cpp
ifeq ($(PCB), 9XR128)
CPPDEFS += -DPCB9XR128
else
@@ -532,7 +537,7 @@ ifeq ($(PCB), SKY9X)
SRC += targets/sky9x/MEDSdcard.c
EEPROMSRC = eeprom_common.cpp eeprom_raw.cpp eeprom_conversions.cpp
PULSESSRC = protocols/pulses_arm.cpp protocols/ppm_arm.cpp protocols/pxx_arm.cpp protocols/dsm2_arm.cpp
CPPSRC += audio_arm.cpp haptic.cpp
CPPSRC += audio_arm.cpp haptic.cpp gui/view_about.cpp
CPPSRC += targets/sky9x/pwr_driver.cpp targets/sky9x/adc_driver.cpp targets/sky9x/coproc_driver.cpp targets/sky9x/rotenc_driver.cpp targets/sky9x/eeprom_driver.cpp targets/sky9x/pulses_driver.cpp targets/sky9x/keys_driver.cpp targets/sky9x/audio_driver.cpp targets/sky9x/buzzer_driver.cpp targets/sky9x/haptic_driver.cpp targets/sky9x/sdcard_driver.cpp targets/sky9x/massstorage.cpp
ifeq ($(SDCARD), YES)
@@ -615,7 +620,6 @@ ifeq ($(PCB), TARANIS)
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
# SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c
EXTRABOARDSRC += targets/taranis/usbd_usr.cpp targets/taranis/usbd_storage_msd.cpp
ifeq ($(SDCARD), YES)
@@ -634,6 +638,10 @@ ifeq ($(PCB), TARANIS)
SRC += targets/sky9x/syscalls.c
endif
ifeq ($(DSM2), PPM)
CPPSRC += protocols/dsm2_arm.cpp
endif
ifeq ($(HUBSAN), YES)
CPPDEFS += -DHUBSAN
CPPSRC += protocols/hubsan.cpp
@@ -710,6 +718,9 @@ endif
ifeq ($(NAVIGATION), POTS)
CPPDEFS += -DNAVIGATION_POT1 -DNAVIGATION_POT2 -DNAVIGATION_POT3
endif
ifeq ($(NAVIGATION), STICKS)
CPPDEFS += -DNAVIGATION_STICKS
endif
ifeq ($(NAVIGATION), ROTENC)
CPPDEFS += -DROTARY_ENCODER_NAVIGATION
endif
@@ -889,6 +900,13 @@ ifeq ($(PPM_UNIT), PERCENT_PREC0)
CPPDEFS += -DPPM_UNIT_PERCENT_PREC0
endif
ifeq ($(FAI), YES)
CPPDEFS += -DFAI
endif
ifeq ($(FAI), CHOICE)
CPPDEFS += -DFAI_CHOICE
endif
ifeq ($(HELI), YES)
CPPDEFS += -DHELI
endif
@@ -1016,7 +1034,7 @@ else
build: stamp_header lbm allsrc.cpp elf remallsrc bin lss
endif
lbm: bitmaps/font.lbm bitmaps/sticks.lbm
lbm: fonts/std/font_05x07.lbm bitmaps/sticks.lbm
elf: $(TARGET).elf
bin: $(TARGET).bin
@@ -1071,30 +1089,48 @@ taranis-stamp:
@echo "#define SVN_VERS \"opentx-r$(SVNREV)\"" >> stamp-opentx-taranis.txt
@cat stamp-opentx-taranis.txt
bitmaps/font.lbm: bitmaps/font.xbm bitmaps/font_extra.xbm bitmaps/font_tiny.xbm bitmaps/font_small.xbm bitmaps/font_midsize.xbm bitmaps/font_dblsize.xbm bitmaps/font_dblsize_extra.xbm bitmaps/font_small_extra.xbm translations/font_se.xbm translations/font_de.xbm translations/font_it.xbm translations/font_cz.xbm translations/font_fr.xbm translations/font_es.xbm translations/font_dblsize_se.xbm translations/font_dblsize_de.xbm translations/font_dblsize_it.xbm translations/font_dblsize_fr.xbm translations/font_dblsize_es.xbm
fonts/std/font_05x07.lbm: fonts/std/font_03x05.png fonts/std/font_04x06.png fonts/std/font_05x07.png fonts/std/font_08x10.png fonts/std/font_10x14.png fonts/std/font_10x14_compressed.png fonts/std/font_04x06_extra.png fonts/std/font_05x07_extra.png fonts/std/font_10x14_extra.png fonts/std/font_se_05x07.png fonts/std/font_de_05x07.png fonts/std/font_it_05x07.png fonts/std/font_cz_05x07.png fonts/std/font_fr_05x07.png fonts/std/font_es_05x07.png fonts/std/font_se_10x14.png fonts/std/font_de_10x14.png fonts/std/font_it_10x14.png fonts/std/font_fr_10x14.png fonts/std/font_es_10x14.png
@echo
@echo "Convert fonts from xbm to lbm:"
$(IMG2LBM) bitmaps/font.xbm bitmaps/font.lbm 5x7
$(IMG2LBM) bitmaps/font_extra.xbm bitmaps/font_extra.lbm 5x7
$(IMG2LBM) bitmaps/font_tiny.xbm bitmaps/font_tiny.lbm 3x5
$(IMG2LBM) bitmaps/font_small.xbm bitmaps/font_small.lbm 4x6
$(IMG2LBM) bitmaps/font_midsize.xbm bitmaps/font_midsize.lbm 8x10
$(IMG2LBM) bitmaps/font_dblsize.xbm bitmaps/font_dblsize.lbm 10x14
$(IMG2LBM) bitmaps/font_dblsize_extra.xbm bitmaps/font_dblsize_extra.lbm 10x14
$(IMG2LBM) bitmaps/font_small_extra.xbm bitmaps/font_small_extra.lbm 4x6
$(IMG2LBM) translations/font_se.xbm translations/font_se.lbm 5x7
$(IMG2LBM) translations/font_de.xbm translations/font_de.lbm 5x7
$(IMG2LBM) translations/font_it.xbm translations/font_it.lbm 5x7
$(IMG2LBM) translations/font_cz.xbm translations/font_cz.lbm 5x7
$(IMG2LBM) translations/font_fr.xbm translations/font_fr.lbm 5x7
$(IMG2LBM) translations/font_es.xbm translations/font_es.lbm 5x7
$(IMG2LBM) translations/font_dblsize_se.xbm translations/font_dblsize_se.lbm 10x14
$(IMG2LBM) translations/font_dblsize_de.xbm translations/font_dblsize_de.lbm 10x14
$(IMG2LBM) translations/font_dblsize_it.xbm translations/font_dblsize_it.lbm 10x14
$(IMG2LBM) translations/font_dblsize_fr.xbm translations/font_dblsize_fr.lbm 10x14
$(IMG2LBM) translations/font_dblsize_es.xbm translations/font_dblsize_es.lbm 10x14
@echo "Convert fonts from png to lbm:"
$(IMG2LBM) fonts/std/font_03x05.png fonts/std/font_03x05.lbm 3x5
$(IMG2LBM) fonts/std/font_04x06.png fonts/std/font_04x06.lbm 4x6
$(IMG2LBM) fonts/std/font_05x07.png fonts/std/font_05x07.lbm 5x7
$(IMG2LBM) fonts/std/font_08x10.png fonts/std/font_08x10.lbm 8x10
$(IMG2LBM) fonts/std/font_10x14.png fonts/std/font_10x14.lbm 10x14
$(IMG2LBM) fonts/std/font_10x14_compressed.png fonts/std/font_10x14_compressed.lbm 10x14
$(IMG2LBM) fonts/std/font_04x06_extra.png fonts/std/font_04x06_extra.lbm 4x6
$(IMG2LBM) fonts/std/font_05x07_extra.png fonts/std/font_05x07_extra.lbm 5x7
$(IMG2LBM) fonts/std/font_10x14_extra.png fonts/std/font_10x14_extra.lbm 10x14
$(IMG2LBM) fonts/std/font_cz_04x06.png fonts/std/font_cz_04x06.lbm 4x6
$(IMG2LBM) fonts/std/font_cz_05x07.png fonts/std/font_cz_05x07.lbm 5x7
$(IMG2LBM) fonts/std/font_cz_08x10.png fonts/std/font_cz_08x10.lbm 8x10
$(IMG2LBM) fonts/std/font_cz_10x14.png fonts/std/font_cz_10x14.lbm 10x14
$(IMG2LBM) fonts/std/font_de_04x06.png fonts/std/font_de_04x06.lbm 4x6
$(IMG2LBM) fonts/std/font_de_05x07.png fonts/std/font_de_05x07.lbm 5x7
$(IMG2LBM) fonts/std/font_de_08x10.png fonts/std/font_de_08x10.lbm 8x10
$(IMG2LBM) fonts/std/font_de_10x14.png fonts/std/font_de_10x14.lbm 10x14
$(IMG2LBM) fonts/std/font_es_04x06.png fonts/std/font_es_04x06.lbm 4x6
$(IMG2LBM) fonts/std/font_es_05x07.png fonts/std/font_es_05x07.lbm 5x7
$(IMG2LBM) fonts/std/font_es_08x10.png fonts/std/font_es_08x10.lbm 8x10
$(IMG2LBM) fonts/std/font_es_10x14.png fonts/std/font_es_10x14.lbm 10x14
$(IMG2LBM) fonts/std/font_fr_04x06.png fonts/std/font_fr_04x06.lbm 4x6
$(IMG2LBM) fonts/std/font_fr_05x07.png fonts/std/font_fr_05x07.lbm 5x7
$(IMG2LBM) fonts/std/font_fr_08x10.png fonts/std/font_fr_08x10.lbm 8x10
$(IMG2LBM) fonts/std/font_fr_10x14.png fonts/std/font_fr_10x14.lbm 10x14
$(IMG2LBM) fonts/std/font_it_04x06.png fonts/std/font_it_04x06.lbm 4x6
$(IMG2LBM) fonts/std/font_it_05x07.png fonts/std/font_it_05x07.lbm 5x7
$(IMG2LBM) fonts/std/font_it_08x10.png fonts/std/font_it_08x10.lbm 8x10
$(IMG2LBM) fonts/std/font_it_10x14.png fonts/std/font_it_10x14.lbm 10x14
$(IMG2LBM) fonts/std/font_pt_04x06.png fonts/std/font_pt_04x06.lbm 4x6
$(IMG2LBM) fonts/std/font_pt_05x07.png fonts/std/font_pt_05x07.lbm 5x7
$(IMG2LBM) fonts/std/font_pt_08x10.png fonts/std/font_pt_08x10.lbm 8x10
$(IMG2LBM) fonts/std/font_pt_10x14.png fonts/std/font_pt_10x14.lbm 10x14
$(IMG2LBM) fonts/std/font_se_04x06.png fonts/std/font_se_04x06.lbm 4x6
$(IMG2LBM) fonts/std/font_se_05x07.png fonts/std/font_se_05x07.lbm 5x7
$(IMG2LBM) fonts/std/font_se_08x10.png fonts/std/font_se_08x10.lbm 8x10
$(IMG2LBM) fonts/std/font_se_10x14.png fonts/std/font_se_10x14.lbm 10x14
bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/splash_9x.xbm bitmaps/splash_taranis.png bitmaps/logo_taranis.bmp bitmaps/icons.png bitmaps/asterisk.xbm bitmaps/about.png bitmaps/asterisk_4bits.png
bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/splash_9x.xbm bitmaps/splash_taranis.png bitmaps/logo_taranis.bmp bitmaps/icons.png bitmaps/asterisk.xbm bitmaps/about_9x.png bitmaps/about_taranis.png bitmaps/asterisk_4bits.png
@echo
@echo "Convert bitmaps from xbm to lbm:"
$(IMG2LBM) bitmaps/sticks_4x1.xbm bitmaps/sticks.lbm img 4
@@ -1103,7 +1139,8 @@ bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/splash_9x.xbm bitmaps/splash_
$(IMG2LBM) bitmaps/logo_taranis.bmp bitmaps/logo_taranis.lbm bmp
$(IMG2LBM) bitmaps/icons.png bitmaps/icons.lbm bmp
$(IMG2LBM) bitmaps/asterisk.xbm bitmaps/asterisk.lbm img
$(IMG2LBM) bitmaps/about.png bitmaps/about.lbm bmp
$(IMG2LBM) bitmaps/about_taranis.png bitmaps/about_taranis.lbm bmp
$(IMG2LBM) bitmaps/about_9x.png bitmaps/about_9x.lbm img
$(IMG2LBM) bitmaps/asterisk_4bits.png bitmaps/asterisk_4bits.lbm bmp
# Eye candy.
@@ -1215,7 +1252,7 @@ OBJS = $(TMP:.s=.o)
@echo
@echo $(MSG_COMPILING) $@
$(CC) $(ARMCPPFLAGS) $< -o allsrc.o
$(CC) $(OBJS) allsrc.o -mcpu=cortex-m3 -mthumb -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(TARGET).map,--cref,--no-warn-mismatch -o $@
$(CC) $(OBJS) allsrc.o -mcpu=cortex-m3 -mthumb -nostartfiles -lm -T$(LDSCRIPT) -Wl,-Map=$(TARGET).map,--cref,--no-warn-mismatch -o $@
endif
# Target: clean project.
+343 -387
View File
File diff suppressed because it is too large Load Diff
+118 -51
View File
@@ -41,53 +41,87 @@
#define AUDIO_FILENAME_MAXLEN (40)
#define AUDIO_QUEUE_LENGTH (20)
#define BEEP_DEFAULT_FREQ (140)
#define BEEP_OFFSET (10)
#define BEEP_KEY_UP_FREQ (BEEP_DEFAULT_FREQ+10)
#define BEEP_KEY_DOWN_FREQ (BEEP_DEFAULT_FREQ-10)
extern uint16_t Sine_values[];
#define AUDIO_SAMPLE_RATE (32000)
#define AUDIO_BUFFER_DURATION (10)
#define AUDIO_BUFFER_SIZE (AUDIO_SAMPLE_RATE*AUDIO_BUFFER_DURATION/1000)
#define AUDIO_BUFFER_COUNT (3)
class ToneFragment {
public:
uint16_t freq;
uint8_t duration;
uint8_t pause;
uint8_t repeat;
int8_t freqIncr;
uint8_t id;
#define BEEP_MIN_FREQ (440)
#define BEEP_DEFAULT_FREQ (2250)
#define BEEP_KEY_UP_FREQ (BEEP_DEFAULT_FREQ+150)
#define BEEP_KEY_DOWN_FREQ (BEEP_DEFAULT_FREQ-150)
#define AUDIO_BUFFER_FREE (0)
#define AUDIO_BUFFER_FILLED (1)
#define AUDIO_BUFFER_PLAYING (2)
struct AudioBuffer {
uint16_t data[AUDIO_BUFFER_SIZE];
uint16_t size;
uint8_t state;
};
class AudioFragment : public ToneFragment {
public:
#define FRAGMENT_EMPTY 0
#define FRAGMENT_TONE 1
#define FRAGMENT_FILE 2
struct AudioFragment {
uint8_t type;
uint8_t id;
uint8_t repeat;
union {
struct {
uint16_t freq;
uint16_t duration;
uint16_t pause;
int8_t freqIncr;
} tone;
char file[AUDIO_FILENAME_MAXLEN+1];
};
void clear()
{
memset(this, 0, sizeof(AudioFragment));
}
};
extern "C" void DAC_IRQHandler();
#define AUDIO_NOT_STARTED 0
#define AUDIO_SLEEPING 1
#define AUDIO_RESUMING 2
#define AUDIO_PLAYING_TONE 3
#define AUDIO_PLAYING_WAV 4
extern bool playingBackground;
class AudioContext {
public:
AudioFragment fragment;
union {
#if defined(SDCARD)
FIL wavFile;
struct {
FIL file;
uint8_t codec;
uint32_t freq;
uint32_t size;
uint8_t resampleRatio;
uint16_t readSize;
} wav;
#endif
uint8_t pcmCodec;
uint32_t pcmFreq;
uint32_t wavSize;
struct {
uint16_t points[100];
uint8_t count;
uint8_t idx;
uint16_t freq;
} tone;
} state;
inline void clear()
{
fragment.clear();
}
};
bool dacQueue(AudioBuffer *buffer);
class AudioQueue {
friend void audioTask(void* pdata);
friend void DAC_IRQHandler();
public:
@@ -95,13 +129,13 @@ class AudioQueue {
void start();
void play(uint16_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tFlags=0, int8_t tFreqIncr=0);
void play(uint16_t freq, uint16_t len, uint16_t pause=0, uint8_t flags=0, int8_t freqIncr=0);
void playFile(const char *filename, uint8_t flags=0, uint8_t id=0);
void stopPlay(uint8_t id);
void pause(uint8_t tLen);
void pause(uint16_t tLen);
void stopSD();
@@ -109,16 +143,7 @@ class AudioQueue {
bool started()
{
return (state != AUDIO_NOT_STARTED);
}
bool busy()
{
#ifdef SIMU
return false;
#else
return (state != AUDIO_SLEEPING);
#endif
return state;
}
bool empty()
@@ -128,27 +153,69 @@ class AudioQueue {
void reset();
inline AudioBuffer * getNextFilledBuffer()
{
if (buffers[bufferRIdx].state == AUDIO_BUFFER_PLAYING) {
buffers[bufferRIdx].state = AUDIO_BUFFER_FREE;
bufferRIdx = nextBufferIdx(bufferRIdx);
}
uint8_t idx = bufferRIdx;
while (idx != bufferWIdx) {
AudioBuffer * buffer = &buffers[idx];
if (buffer->state == AUDIO_BUFFER_FILLED) {
buffer->state = AUDIO_BUFFER_PLAYING;
return buffer;
}
idx = nextBufferIdx(idx);
}
return NULL;
}
protected:
void wakeup();
void sdWakeup(AudioContext & context);
int mixAudioContext(AudioContext &context, AudioBuffer *buffer, int beepVolume, int wavVolume, unsigned int fade);
int mixBeep(AudioContext &context, AudioBuffer *buffer, int volume, unsigned int fade);
int mixWav(AudioContext &context, AudioBuffer *buffer, int volume, unsigned int fade);
volatile uint8_t state;
volatile bool state;
uint8_t ridx;
uint8_t widx;
int8_t prioIdx;
AudioFragment fragments[AUDIO_QUEUE_LENGTH];
AudioContext currentContext;
AudioContext backgroundContext; // for background music / vario
AudioContext currentContext;
AudioContext foregroundContext; // for important beeps
AudioBuffer buffers[AUDIO_BUFFER_COUNT];
uint8_t bufferRIdx;
uint8_t bufferWIdx;
inline uint8_t nextBufferIdx(uint8_t idx)
{
return (idx == AUDIO_BUFFER_COUNT-1 ? 0 : idx+1);
}
inline AudioBuffer * getEmptyBuffer()
{
AudioBuffer * buffer = &buffers[bufferWIdx];
if (buffer->state == AUDIO_BUFFER_FREE)
return buffer;
else
return NULL;
}
void pushBuffer(AudioBuffer *buffer);
};
extern AudioQueue audioQueue;
void codecsInit();
void audioEvent(uint8_t e, uint8_t f=BEEP_DEFAULT_FREQ);
void audioEvent(uint8_t e, uint16_t f=BEEP_DEFAULT_FREQ);
void audioStart();
#if defined(AUDIO) && defined(BUZZER)
@@ -181,8 +248,7 @@ void audioStart();
#define AUDIO_ERROR() AUDIO_BUZZER(audioEvent(AU_ERROR), beep(4))
#define AUDIO_TIMER_30() AUDIO_BUZZER(audioEvent(AU_TIMER_30), { beepAgain=2; beep(2); })
#define AUDIO_TIMER_20() AUDIO_BUZZER(audioEvent(AU_TIMER_20), { beepAgain=1; beep(2); })
#define AUDIO_TIMER_10() AUDIO_BUZZER(audioEvent(AU_TIMER_10), beep(2))
#define AUDIO_TIMER_LT3(x) AUDIO_BUZZER(audioEvent(AU_TIMER_LT3), beep(2))
#define AUDIO_TIMER_LT10(x) AUDIO_BUZZER(audioEvent(AU_TIMER_LT10), beep(2))
#define AUDIO_INACTIVITY() AUDIO_BUZZER(audioEvent(AU_INACTIVITY), beep(3))
#define AUDIO_MIX_WARNING(x) AUDIO_BUZZER(audioEvent(AU_MIX_WARNING_1+x-1), beep(1))
#define AUDIO_POT_STICK_MIDDLE() AUDIO_BUZZER(audioEvent(AU_POT_STICK_MIDDLE), beep(2))
@@ -204,6 +270,9 @@ void audioStart();
#define AUDIO_SWR_RED() audioEvent(AU_SWR_RED)
#endif
#define AUDIO_TELEMETRY_LOST() audioEvent(AU_TELEMETRY_LOST)
#define AUDIO_TELEMETRY_BACK() audioEvent(AU_TELEMETRY_BACK)
#define AUDIO_HEARTBEAT()
#define SYSTEM_AUDIO_CATEGORY 0
@@ -241,8 +310,6 @@ extern void refreshModelAudioFiles();
extern bool isAudioFileAvailable(uint32_t i, char * filename);
// TODO not public, everything could be inside a function in audio_arm.cpp
extern OS_TCID audioTimer;
extern OS_FlagID audioFlag;
extern OS_MutexID audioMutex;
#endif
+42 -112
View File
@@ -131,10 +131,9 @@ void audioQueue::play(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tFlag
int8_t tFreqIncr = (tFlags >> 6);
if (tFreqIncr == 3) tFreqIncr = -1;
if (tFreq > 0) { //we dont add pitch if zero as this is a pause only event
tFreq += g_eeGeneral.speakerPitch + BEEP_OFFSET; // add pitch compensator
}
tFreq += g_eeGeneral.speakerPitch + BEEP_OFFSET; // add pitch compensator
tLen = getToneLength(tLen);
if ((tFlags & PLAY_NOW) || (!busy() && empty())) {
toneFreq = tFreq;
toneTimeLeft = tLen;
@@ -167,7 +166,7 @@ void audioQueue::event(uint8_t e, uint8_t f)
haptic.event(e); //do this before audio to help sync timings
#endif
if (e <= AU_ERROR || e >= AU_WARNING1) {
if (e <= AU_ERROR || (e >= AU_WARNING1 && e < AU_FRSKY_FIRST)) {
if (g_eeGeneral.alarmsFlash) {
flashCounter = FLASH_DURATION;
}
@@ -177,163 +176,94 @@ void audioQueue::event(uint8_t e, uint8_t f)
if (e < AU_FRSKY_FIRST || empty()) {
// TODO when VOICE enable some cases here are not needed!
switch (e) {
// inactivity timer alert
case AU_INACTIVITY:
play(70, 10, 2, PLAY_REPEAT(2)|PLAY_NOW);
break;
// low battery in tx
#if !defined(VOICE)
case AU_TX_BATTERY_LOW:
if (empty()) {
play(60, 20, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(1));
play(80, 20, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(-1));
}
break;
// error
case AU_ERROR:
play(BEEP_DEFAULT_FREQ, 40, 1, PLAY_NOW);
break;
// keypad up (seems to be used when going left/right through system menu options. 0-100 scales etc)
case AU_KEYPAD_UP:
play(BEEP_KEY_UP_FREQ, 10, 1, PLAY_NOW);
break;
// keypad down (seems to be used when going left/right through system menu options. 0-100 scales etc)
case AU_KEYPAD_DOWN:
play(BEEP_KEY_DOWN_FREQ, 10, 1, PLAY_NOW);
break;
// menu display (also used by a few generic beeps)
case AU_MENUS:
play(BEEP_DEFAULT_FREQ, 10, 2, PLAY_NOW);
break;
// trim move
#endif
case AU_TRIM_MOVE:
play(f, 6, 1, PLAY_NOW);
break;
// trim center
case AU_TRIM_MIDDLE:
play(f, 10, 2, PLAY_NOW);
break;
// warning one
case AU_WARNING1:
play(BEEP_DEFAULT_FREQ, 10, 1, PLAY_NOW);
break;
// warning two
case AU_WARNING2:
play(BEEP_DEFAULT_FREQ, 20, 1, PLAY_NOW);
break;
// warning three
case AU_WARNING3:
play(BEEP_DEFAULT_FREQ, 30, 1, PLAY_NOW);
break;
// pot/stick center
case AU_POT_STICK_MIDDLE:
play(BEEP_DEFAULT_FREQ + 50, 10, 1, PLAY_NOW);
break;
// mix warning 1
case AU_MIX_WARNING_1:
play(BEEP_DEFAULT_FREQ + 50, 6, 0);
break;
// mix warning 2
case AU_MIX_WARNING_2:
play(BEEP_DEFAULT_FREQ + 52, 6, 3, PLAY_REPEAT(1));
break;
// mix warning 3
case AU_MIX_WARNING_3:
play(BEEP_DEFAULT_FREQ + 54, 6, 3, PLAY_REPEAT(2));
break;
// time 30 seconds left
case AU_TIMER_30:
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(2)|PLAY_NOW);
break;
// time 20 seconds left
case AU_TIMER_20:
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(1)|PLAY_NOW);
break;
// time 10 seconds left
case AU_TIMER_10:
// time <3 seconds left
case AU_TIMER_LT3:
play(BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_NOW);
break;
case AU_FRSKY_BEEP1:
play(BEEP_DEFAULT_FREQ, 10, 1);
pause(200);
break;
case AU_FRSKY_BEEP2:
play(BEEP_DEFAULT_FREQ, 20, 1);
pause(200);
break;
case AU_FRSKY_BEEP3:
play(BEEP_DEFAULT_FREQ, 30, 1);
pause(200);
break;
case AU_FRSKY_WARN1:
play(BEEP_DEFAULT_FREQ+20, 15, 5, PLAY_REPEAT(2));
pause(200);
break;
case AU_FRSKY_WARN2:
play(BEEP_DEFAULT_FREQ+30, 15, 5, PLAY_REPEAT(2));
pause(200);
break;
case AU_FRSKY_CHEEP:
play(BEEP_DEFAULT_FREQ+30, 10, 2, PLAY_REPEAT(2)|PLAY_INCREMENT(2));
pause(200);
break;
case AU_FRSKY_RING:
play(BEEP_DEFAULT_FREQ+25, 5, 2, PLAY_REPEAT(10));
play(BEEP_DEFAULT_FREQ+25, 5, 10, PLAY_REPEAT(1));
play(BEEP_DEFAULT_FREQ+25, 5, 2, PLAY_REPEAT(10));
pause(200);
break;
case AU_FRSKY_SCIFI:
play(80, 10, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(-1));
play(60, 10, 3, PLAY_REPEAT(2)|PLAY_INCREMENT(1));
play(70, 10, 1);
pause(200);
break;
case AU_FRSKY_ROBOT:
play(70, 5, 1, PLAY_REPEAT(1));
play(50, 15, 2, PLAY_REPEAT(1));
play(80, 15, 2, PLAY_REPEAT(1));
pause(200);
break;
case AU_FRSKY_CHIRP:
play(BEEP_DEFAULT_FREQ+40, 5, 1, PLAY_REPEAT(2));
play(BEEP_DEFAULT_FREQ+54, 5, 1, PLAY_REPEAT(3));
pause(200);
break;
case AU_FRSKY_TADA:
play(50, 5, 5);
play(90, 5, 5);
play(110, 3, 4, PLAY_REPEAT(2));
pause(200);
break;
case AU_FRSKY_CRICKET:
play(80, 5, 10, PLAY_REPEAT(3));
play(80, 5, 20, PLAY_REPEAT(1));
play(80, 5, 10, PLAY_REPEAT(3));
pause(200);
break;
case AU_FRSKY_SIREN:
play(10, 20, 5, PLAY_REPEAT(2)|PLAY_INCREMENT(1));
pause(200);
break;
case AU_FRSKY_ALARMC:
play(50, 4, 10, PLAY_REPEAT(2));
play(70, 8, 20, PLAY_REPEAT(1));
play(50, 8, 10, PLAY_REPEAT(2));
play(70, 4, 20, PLAY_REPEAT(1));
pause(200);
break;
case AU_FRSKY_RATATA:
play(BEEP_DEFAULT_FREQ+50, 5, 10, PLAY_REPEAT(10));
pause(200);
break;
case AU_FRSKY_TICK:
play(BEEP_DEFAULT_FREQ+50, 5, 50, PLAY_REPEAT(2));
pause(200);
break;
default:
{
const static pm_uint8_t singleSounds[] PROGMEM = {
70, 10, 2, PLAY_REPEAT(2)|PLAY_NOW, // INACTIVITY
BEEP_DEFAULT_FREQ, 40, 1, PLAY_NOW, // ERROR
BEEP_KEY_UP_FREQ, 10, 1, PLAY_NOW, // KEYPAD_UP
BEEP_KEY_DOWN_FREQ, 10, 1, PLAY_NOW, // KEYPAD_DOWN
BEEP_DEFAULT_FREQ, 10, 2, PLAY_NOW, // MENUS
0,0,0,0, // TRIM_MOVE
BEEP_DEFAULT_FREQ, 10, 1, PLAY_NOW, // WARNING1
BEEP_DEFAULT_FREQ, 20, 1, PLAY_NOW, // WARNING2
BEEP_DEFAULT_FREQ, 30, 1, PLAY_NOW, // WARNING3
0,0,0,0, // TRIM_MIDDLE
BEEP_DEFAULT_FREQ + 50, 10, 1, PLAY_NOW, // POT_STICK_MIDDLE
BEEP_DEFAULT_FREQ + 50, 6, 0, 0, // MIX_WARNING_1
BEEP_DEFAULT_FREQ + 52, 6, 3, PLAY_REPEAT(1), // MIX_WARNING_2
BEEP_DEFAULT_FREQ + 54, 6, 3, PLAY_REPEAT(2), // MIX_WARNING_3
BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_NOW, // TIMER_LT10
BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(1)|PLAY_NOW, // TIMER_20
BEEP_DEFAULT_FREQ + 50, 15, 3, PLAY_REPEAT(2)|PLAY_NOW, // TIMER_30
BEEP_DEFAULT_FREQ, 10, 1, 0, // FRSKY_BEEP1
BEEP_DEFAULT_FREQ, 20, 1, 0, // FRSKY_BEEP2
BEEP_DEFAULT_FREQ, 30, 1, 0, // FRSKY_BEEP3
BEEP_DEFAULT_FREQ+20, 15, 5, PLAY_REPEAT(2), // FRSKY_WARN1
BEEP_DEFAULT_FREQ+30, 15, 5, PLAY_REPEAT(2), // FRSKY_WARN2
BEEP_DEFAULT_FREQ+30, 10, 2, PLAY_REPEAT(2)|PLAY_INCREMENT(2), // FRSKY_CHEEP
BEEP_DEFAULT_FREQ+50, 5, 10, PLAY_REPEAT(10), // FRSKY_RATATA
BEEP_DEFAULT_FREQ+50, 5, 50, PLAY_REPEAT(2), // FRSKY_TICK
10, 20, 5, PLAY_REPEAT(2)|PLAY_INCREMENT(1), // FRSKY_SIREN
};
const pm_uint8_t *ptr = &singleSounds[(e-AU_INACTIVITY)<<2];
uint8_t tFreq = pgm_read_byte(ptr++);
uint8_t tLen = pgm_read_byte(ptr++);
uint8_t tPause = pgm_read_byte(ptr++);
uint8_t tFlags = pgm_read_byte(ptr);
play(tFreq, tLen, tPause, tFlags);
break;
}
}
}
}
+3 -4
View File
@@ -136,10 +136,9 @@ void audioDefevent(uint8_t e);
#define AUDIO_INACTIVITY() VOICE_AUDIO_BUZZER(PUSH_SYSTEM_PROMPT(AU_INACTIVITY), audioDefevent(AU_INACTIVITY), beep(3))
#define AUDIO_ERROR_MESSAGE(e) VOICE_AUDIO_BUZZER(PUSH_SYSTEM_PROMPT((e)), audioDefevent(AU_ERROR), beep(4))
#define AUDIO_TIMER_MINUTE(t) VOICE_AUDIO_BUZZER(playDuration(t), audioDefevent(AU_WARNING1), beep(2))
#define AUDIO_TIMER_30() VOICE_AUDIO_BUZZER(PUSH_SYSTEM_PROMPT(AU_TIMER_30), audioDefevent(AU_TIMER_30), { beepAgain=2; beep(2); })
#define AUDIO_TIMER_20() VOICE_AUDIO_BUZZER(PUSH_SYSTEM_PROMPT(AU_TIMER_20), audioDefevent(AU_TIMER_20), { beepAgain=1; beep(2); })
#define AUDIO_TIMER_10() VOICE_AUDIO_BUZZER(PUSH_SYSTEM_PROMPT(AU_TIMER_10), audioDefevent(AU_TIMER_10), beep(2))
#define AUDIO_TIMER_LT3(x) VOICE_AUDIO_BUZZER(PUSH_SYSTEM_PROMPT(AU_TIMER_LT3), audioDefevent(AU_TIMER_LT3), beep(2))
#define AUDIO_TIMER_30() VOICE_AUDIO_BUZZER(PUSH_SYSTEM_PROMPT(AU_TIMER_30+1/*to avoid renumbering*/), audioDefevent(AU_TIMER_30), { beepAgain=2; beep(2); })
#define AUDIO_TIMER_20() VOICE_AUDIO_BUZZER(PUSH_SYSTEM_PROMPT(AU_TIMER_20+1/*to avoid renumbering*/), audioDefevent(AU_TIMER_20), { beepAgain=1; beep(2); })
#define AUDIO_TIMER_LT10(x) AUDIO_BUZZER(audioDefevent(AU_TIMER_LT10), beep(2))
#define AUDIO_MIX_WARNING(x) AUDIO_BUZZER(audioDefevent(AU_MIX_WARNING_1+x-1), beep(1))
#define AUDIO_POT_STICK_MIDDLE() AUDIO_BUZZER(audioDefevent(AU_POT_STICK_MIDDLE), beep(2))
#define AUDIO_VARIO_UP() audioDefevent(AU_KEYPAD_UP)
+4
View File
@@ -0,0 +1,4 @@
11,17,
0x00,0x80,0x80,0xbe,0xe3,0xc1,0xc1,0xc1,0xe3,0xff,0xff,
0x00,0xe7,0x24,0x3c,0x00,0x00,0x00,0x00,0x3f,0x3f,0xff,
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,
Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Before

Width:  |  Height:  |  Size: 740 B

After

Width:  |  Height:  |  Size: 740 B

-43
View File
@@ -1,43 +0,0 @@
#define font_width 80
#define font_height 48
static unsigned char font_bits[] = {
0x00, 0x29, 0xe0, 0x86, 0x31, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29,
0xe8, 0x66, 0x22, 0x84, 0x10, 0x02, 0x00, 0x80, 0x00, 0x29, 0xec, 0x50,
0x11, 0x02, 0x55, 0x02, 0x00, 0x40, 0x00, 0x81, 0xf6, 0x89, 0x00, 0x02,
0xb9, 0x0f, 0x3c, 0x20, 0x00, 0x80, 0xe3, 0x44, 0x05, 0x02, 0x55, 0x62,
0x00, 0x10, 0x00, 0x01, 0xe1, 0x72, 0x02, 0x84, 0x10, 0x42, 0x80, 0x09,
0x00, 0x01, 0xe0, 0xb0, 0x05, 0x48, 0x00, 0x20, 0x80, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x31, 0x07, 0x3d,
0xf3, 0x8c, 0x01, 0x00, 0x41, 0x70, 0x92, 0x49, 0x88, 0x85, 0x84, 0x52,
0x32, 0x86, 0x80, 0x88, 0x12, 0x41, 0x48, 0x9d, 0x40, 0x52, 0x32, 0x46,
0x3e, 0x81, 0x12, 0x21, 0x26, 0xa1, 0x23, 0x8c, 0x03, 0x20, 0x00, 0x42,
0x12, 0x11, 0xe8, 0xa1, 0x24, 0x12, 0x32, 0x46, 0x3e, 0x21, 0x12, 0x09,
0x08, 0xa5, 0x24, 0x12, 0x31, 0x84, 0x80, 0x00, 0x8c, 0x7b, 0x07, 0x19,
0x23, 0x8c, 0x00, 0x02, 0x41, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xc6, 0x3d, 0x77, 0xfe, 0x77, 0xd1, 0xf1, 0x18,
0x62, 0x74, 0x29, 0xc6, 0x98, 0x42, 0x88, 0x91, 0xa0, 0x14, 0x76, 0x8c,
0x29, 0xc6, 0x10, 0x43, 0x08, 0x91, 0xa0, 0x12, 0xea, 0x8c, 0xe6, 0xbf,
0x10, 0xdf, 0xeb, 0x9f, 0xa0, 0x11, 0x6a, 0x8d, 0x20, 0xc6, 0x10, 0x43,
0x88, 0x91, 0xa0, 0x12, 0x62, 0x8e, 0x20, 0xc6, 0x98, 0x42, 0x88, 0x91,
0xa4, 0x14, 0x62, 0x8c, 0x20, 0x3e, 0x77, 0x7e, 0xf0, 0xd1, 0x99, 0xf8,
0x63, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xcf, 0x3d, 0xf7, 0x63, 0x8c, 0x31, 0x7e, 0x07, 0x1c, 0x01, 0x31, 0xc6,
0x48, 0x62, 0x8c, 0x31, 0x42, 0x11, 0x90, 0x02, 0x31, 0xc6, 0x40, 0x62,
0x8c, 0x2a, 0x22, 0x21, 0x50, 0x04, 0x2f, 0x3e, 0x47, 0x62, 0x8c, 0x44,
0x11, 0x41, 0x10, 0x00, 0xa1, 0x16, 0x48, 0x62, 0xac, 0x8a, 0x08, 0x81,
0x10, 0x00, 0x21, 0xa5, 0x48, 0xa2, 0xaa, 0x91, 0x04, 0x01, 0x11, 0x00,
0xc1, 0x46, 0x47, 0x1c, 0x51, 0x91, 0x7c, 0x07, 0x1c, 0xf8, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x01,
0x03, 0x81, 0xa0, 0x60, 0x00, 0x00, 0x04, 0x04, 0x00, 0x81, 0xf4, 0x01,
0x80, 0x40, 0x00, 0x00, 0xc8, 0x35, 0x67, 0x9d, 0x88, 0xcd, 0xb0, 0x44,
0x56, 0x73, 0x00, 0xce, 0x90, 0xe3, 0x89, 0x93, 0xa0, 0x42, 0xea, 0x8c,
0xc0, 0xc7, 0x10, 0xbf, 0xf0, 0x91, 0xa0, 0x41, 0x6a, 0x8c, 0x20, 0xc6,
0x18, 0x83, 0x80, 0x91, 0xa4, 0x42, 0x62, 0x8c, 0xc0, 0x3f, 0xe7, 0x9d,
0x70, 0xd1, 0x99, 0xe4, 0x62, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10,
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x10, 0x04, 0x21,
0xcf, 0x36, 0x77, 0x62, 0x8c, 0x31, 0x7e, 0x10, 0x08, 0x12, 0x31, 0xcf,
0x20, 0x62, 0x8c, 0x2a, 0x22, 0x15, 0xd0, 0xde, 0xcf, 0x07, 0x27, 0x62,
0x8c, 0xc4, 0x93, 0x12, 0x08, 0x12, 0x01, 0x06, 0x28, 0xb3, 0xaa, 0x0a,
0x0a, 0x10, 0x14, 0x21, 0x01, 0x86, 0xc7, 0x2c, 0x51, 0xd1, 0x7d, 0x10,
0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-163
View File
@@ -1,163 +0,0 @@
#define font_dblsize_width 160
#define font_dblsize_height 96
static unsigned char font_dblsize_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x0c,
0x33, 0x30, 0x18, 0xc0, 0x03, 0x0f, 0xc0, 0x30, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0x0c, 0x33, 0x30, 0x3c, 0xe0,
0x07, 0x0f, 0xe0, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc0, 0xc0, 0x0c, 0x33, 0xfc, 0x3f, 0x7c, 0x0c, 0x0c, 0x70, 0xe0,
0x00, 0x03, 0x0c, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0xc0, 0x0c,
0x33, 0xfe, 0x1b, 0x3e, 0x0e, 0x0e, 0x38, 0xc0, 0x01, 0x03, 0x0c, 0x00,
0x00, 0x00, 0x00, 0xe0, 0x00, 0xc0, 0xc0, 0xcc, 0xff, 0x33, 0x00, 0x37,
0x07, 0x07, 0x1c, 0x80, 0x33, 0x33, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x70,
0x00, 0xc0, 0x80, 0xc4, 0xff, 0x33, 0x80, 0xb3, 0x03, 0x03, 0x0c, 0x00,
0x73, 0x3b, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc0, 0x00, 0x00,
0x33, 0xfe, 0xc0, 0xe1, 0x01, 0x00, 0x0c, 0x00, 0xc3, 0xcf, 0xff, 0x00,
0xf0, 0x0f, 0x00, 0x1c, 0x00, 0xc0, 0x00, 0x00, 0x33, 0xfc, 0xe1, 0xe0,
0x01, 0x00, 0x0c, 0x00, 0xc3, 0xcf, 0xff, 0x00, 0xf0, 0x0f, 0x00, 0x0e,
0x00, 0x00, 0x00, 0xc0, 0xff, 0x30, 0x73, 0xb0, 0x33, 0x00, 0x0c, 0x00,
0x73, 0x3b, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0xc0,
0xff, 0x30, 0x3b, 0x30, 0x3f, 0x00, 0x1c, 0x80, 0x33, 0x33, 0x0c, 0x3c,
0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x33, 0xff, 0x1d, 0x36,
0x0c, 0x00, 0x38, 0xc0, 0x01, 0x03, 0x0c, 0x30, 0x00, 0x80, 0xc1, 0x01,
0x00, 0xc0, 0x00, 0x00, 0x33, 0xff, 0x0c, 0x7f, 0x0c, 0x00, 0x70, 0xe0,
0x00, 0x03, 0x0c, 0x38, 0x00, 0xc0, 0xc3, 0x00, 0x00, 0xc0, 0x00, 0x00,
0x33, 0x30, 0x00, 0xef, 0x3f, 0x00, 0xe0, 0x70, 0x00, 0x00, 0x00, 0x1c,
0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x33, 0x30, 0x00, 0xc6,
0x33, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x80, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xf0, 0xc0, 0x00, 0x0f, 0x3f, 0x00, 0xf3, 0x0f,
0x0f, 0xff, 0xf0, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0x3f,
0xf8, 0xe1, 0x80, 0x1f, 0x7f, 0x80, 0xf3, 0x8f, 0x1f, 0xff, 0xf8, 0xe1,
0x07, 0x00, 0x00, 0x80, 0x03, 0x70, 0x80, 0x7f, 0x9c, 0xf3, 0xc0, 0x39,
0xe0, 0xc0, 0x33, 0xc0, 0x39, 0xc0, 0x9c, 0x73, 0x8e, 0x01, 0x06, 0xc0,
0x01, 0xe0, 0xc0, 0xe1, 0x0c, 0xf3, 0xc0, 0x30, 0xc0, 0xe0, 0x33, 0xc0,
0x30, 0xe0, 0x0c, 0x33, 0xcc, 0x03, 0x0f, 0xe0, 0x00, 0xc0, 0xc1, 0xc0,
0x0c, 0xc3, 0x00, 0x30, 0xc0, 0x70, 0xf3, 0xc3, 0x00, 0x70, 0x0c, 0x33,
0xcc, 0x03, 0x0f, 0x70, 0xfc, 0x8f, 0x03, 0xc0, 0x0c, 0xc3, 0x00, 0x38,
0xe0, 0x38, 0xf3, 0xc7, 0x00, 0x38, 0x9c, 0x73, 0x8e, 0x01, 0x06, 0x38,
0xfc, 0x0f, 0x07, 0xe0, 0x0c, 0xc3, 0x00, 0x1c, 0x7c, 0x1c, 0x03, 0xce,
0x0f, 0x1c, 0xf8, 0xe1, 0x0f, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x70,
0x0c, 0xc3, 0x00, 0x0e, 0x7c, 0x0c, 0x03, 0xcc, 0x1f, 0x0c, 0xf8, 0xc1,
0x0f, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x0e, 0x38, 0x0c, 0xc3, 0x00, 0x07,
0xe0, 0xfc, 0x03, 0xcc, 0x38, 0x0c, 0x9c, 0x03, 0x8c, 0x01, 0x0f, 0x38,
0xfc, 0x0f, 0x07, 0x1c, 0x0c, 0xc3, 0x80, 0x03, 0xc0, 0xfc, 0x03, 0xcc,
0x30, 0x0c, 0x0c, 0x03, 0xce, 0x03, 0x0f, 0x70, 0xfc, 0x8f, 0x03, 0x0c,
0x0c, 0xc3, 0xc0, 0x01, 0xc0, 0x00, 0x33, 0xcc, 0x30, 0x0c, 0x0c, 0x03,
0xc7, 0x03, 0x0c, 0xe0, 0x00, 0xc0, 0x01, 0x00, 0x9c, 0xc3, 0xc0, 0x00,
0xe0, 0x00, 0x73, 0xce, 0x39, 0x0c, 0x9c, 0x83, 0x83, 0x01, 0x0e, 0xc0,
0x01, 0xe0, 0x00, 0x00, 0xf8, 0xf1, 0xc3, 0x3f, 0x7f, 0x00, 0xe3, 0x87,
0x1f, 0x0c, 0xf8, 0xc1, 0x01, 0x00, 0x07, 0x80, 0x03, 0x70, 0x00, 0x0c,
0xf0, 0xf0, 0xc3, 0x3f, 0x3f, 0x00, 0xc3, 0x03, 0x0f, 0x0c, 0xf0, 0xc0,
0x00, 0x00, 0x03, 0x00, 0x03, 0x30, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x3c, 0xc0, 0xf0, 0x0f, 0x3f, 0x3f, 0xfc, 0xff, 0x3f, 0x3f, 0x03, 0xf3,
0x03, 0xff, 0xc0, 0x03, 0x0c, 0x3c, 0x30, 0x3f, 0x7e, 0xe0, 0xf1, 0x9f,
0x7f, 0x7f, 0xfc, 0xff, 0xbf, 0x7f, 0x03, 0xf3, 0x03, 0xff, 0xe0, 0x03,
0x1c, 0x3e, 0xb0, 0x7f, 0xe7, 0xf0, 0x33, 0xf8, 0xe1, 0xe3, 0x0c, 0x30,
0xc0, 0xe1, 0x03, 0xc3, 0x00, 0xcc, 0x70, 0x03, 0x3c, 0x3f, 0xf0, 0xe1,
0xc3, 0x38, 0x37, 0xf0, 0xc0, 0xc3, 0x0d, 0x30, 0xc0, 0xc0, 0x03, 0xc3,
0x00, 0xcc, 0x38, 0x03, 0xfc, 0x7f, 0xf0, 0xc0, 0xc3, 0x1c, 0x3e, 0xf0,
0x00, 0x83, 0x0f, 0x30, 0xc0, 0x00, 0x03, 0xc3, 0x00, 0xcc, 0x1c, 0x03,
0xec, 0xfd, 0xf0, 0xc0, 0xe7, 0x0c, 0x3c, 0xf8, 0x00, 0x03, 0x0f, 0x30,
0xc0, 0x00, 0x03, 0xc3, 0x00, 0xcc, 0x0e, 0x03, 0xcc, 0xfc, 0xf1, 0xc0,
0x7e, 0xfc, 0xff, 0xdf, 0x00, 0x03, 0xff, 0xf3, 0xcf, 0xfc, 0xff, 0xc3,
0x00, 0xcc, 0x07, 0x03, 0xcc, 0xbc, 0xf3, 0xc0, 0x3c, 0xfc, 0xff, 0xdf,
0x00, 0x03, 0xff, 0xf3, 0xcf, 0xfc, 0xff, 0xc3, 0x00, 0xcc, 0x07, 0x03,
0xcc, 0x3c, 0xf7, 0xc0, 0x00, 0x0c, 0x3c, 0xf8, 0x00, 0x03, 0x0f, 0x30,
0xc0, 0xc0, 0x03, 0xc3, 0x00, 0xcc, 0x0e, 0x03, 0x0c, 0x3c, 0xfe, 0xc0,
0x00, 0x0c, 0x3c, 0xf0, 0x00, 0x83, 0x0f, 0x30, 0xc0, 0xc0, 0x03, 0xc3,
0x00, 0xcc, 0x1c, 0x03, 0x0c, 0x3c, 0xfc, 0xc0, 0x00, 0x0c, 0x3c, 0xf0,
0xc0, 0xc3, 0x0d, 0x30, 0xc0, 0xc0, 0x03, 0xc3, 0x30, 0xcc, 0x38, 0x03,
0x0c, 0x3c, 0xf8, 0xc0, 0x00, 0x0c, 0x3c, 0xf8, 0xe1, 0xe3, 0x0c, 0x30,
0xc0, 0xe1, 0x03, 0xc3, 0x70, 0xce, 0x70, 0x03, 0x0c, 0x3c, 0xf0, 0xe1,
0x00, 0x0c, 0xfc, 0x9f, 0x7f, 0x7f, 0xfc, 0x3f, 0x80, 0xff, 0x03, 0xf3,
0xe3, 0xc7, 0xe0, 0xff, 0x0f, 0x3c, 0xb0, 0x7f, 0x00, 0x0c, 0xfc, 0x0f,
0x3f, 0x3f, 0xfc, 0x3f, 0x00, 0x7f, 0x03, 0xf3, 0xc3, 0xc3, 0xc0, 0xff,
0x0f, 0x3c, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf0, 0xf3, 0x0f,
0x3f, 0xff, 0x0f, 0x3c, 0xf0, 0xc0, 0x03, 0x0f, 0xfc, 0x3f, 0x3f, 0x00,
0xf0, 0x03, 0x03, 0x00, 0xff, 0xf9, 0xf7, 0x9f, 0x7f, 0xff, 0x0f, 0x3c,
0xf0, 0xc0, 0x03, 0x0f, 0xfc, 0x3f, 0x3f, 0x00, 0xf0, 0x83, 0x07, 0x00,
0x83, 0x1f, 0x3e, 0xf8, 0xe1, 0x30, 0x0c, 0x3c, 0xf0, 0xc0, 0x03, 0x0f,
0x0c, 0x30, 0x03, 0x03, 0x00, 0xc3, 0x0f, 0x00, 0x03, 0x0f, 0x3c, 0xf0,
0xc0, 0x30, 0x0c, 0x3c, 0xf0, 0xc0, 0x87, 0x0f, 0x0c, 0x38, 0x03, 0x07,
0x00, 0xe3, 0x1c, 0x00, 0x03, 0x0f, 0x3c, 0xf0, 0x00, 0x30, 0x0c, 0x3c,
0xf0, 0xc0, 0xce, 0x0d, 0x0c, 0x1c, 0x03, 0x0e, 0x00, 0x73, 0x38, 0x00,
0x83, 0x0f, 0x3c, 0xf8, 0x01, 0x30, 0x0c, 0x3c, 0xf0, 0xc0, 0xfc, 0x1c,
0x0e, 0x0e, 0x03, 0x1c, 0x00, 0x33, 0x30, 0x00, 0xff, 0x0d, 0xfc, 0x9f,
0x3f, 0x30, 0x0c, 0x3c, 0xf0, 0xc0, 0x78, 0x38, 0x07, 0x07, 0x03, 0x38,
0x00, 0x03, 0x00, 0x00, 0xff, 0x0c, 0xfc, 0x0f, 0x7f, 0x30, 0x0c, 0x3c,
0xf0, 0xc0, 0x78, 0xf0, 0x83, 0x03, 0x03, 0x70, 0x00, 0x03, 0x00, 0x00,
0x03, 0xcc, 0x3c, 0x03, 0xe0, 0x30, 0x0c, 0x3c, 0xf0, 0xcc, 0xfc, 0xe0,
0xc1, 0x01, 0x03, 0xe0, 0x00, 0x03, 0x00, 0x00, 0x03, 0xcc, 0x3d, 0x07,
0xc0, 0x30, 0x0c, 0x7c, 0xf8, 0xcc, 0xce, 0xc1, 0xe0, 0x00, 0x03, 0xc0,
0x01, 0x03, 0x00, 0x00, 0x03, 0x8c, 0x37, 0xce, 0xc0, 0x30, 0x0c, 0xec,
0xdc, 0xcc, 0x87, 0xc3, 0x70, 0x00, 0x03, 0x80, 0x03, 0x03, 0x00, 0x00,
0x03, 0x1c, 0x37, 0xdc, 0xe1, 0x30, 0x1c, 0xce, 0xcf, 0xff, 0x03, 0xc3,
0x30, 0x00, 0x03, 0x00, 0x03, 0x03, 0x00, 0x00, 0x03, 0xf8, 0x3f, 0xb8,
0x7f, 0x30, 0xf8, 0x87, 0x87, 0x7f, 0x03, 0xc3, 0xf0, 0x3f, 0x3f, 0x00,
0xf0, 0x03, 0xc0, 0xff, 0x03, 0xf0, 0x3c, 0x30, 0x3f, 0x30, 0xf0, 0x03,
0x03, 0x33, 0x03, 0xc3, 0xf0, 0x3f, 0x3f, 0x00, 0xf0, 0x03, 0xc0, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x00,
0x0f, 0x00, 0x03, 0xc0, 0x00, 0xcc, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x1c, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x80, 0x1f, 0x00, 0x03, 0xc0,
0x00, 0xcc, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x30, 0x00,
0x00, 0x00, 0x03, 0xc0, 0x39, 0xff, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x30,
0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0xc0,
0xb0, 0xff, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00,
0xe0, 0xf0, 0x33, 0x0f, 0x3f, 0x3c, 0xf3, 0xc3, 0xc0, 0xc1, 0xf3, 0xf0,
0x00, 0xcf, 0x30, 0x30, 0x3c, 0x33, 0x0f, 0x3f, 0xc0, 0xf0, 0xb7, 0x9f,
0x3f, 0x7e, 0xfb, 0xc7, 0xc0, 0xc0, 0xfb, 0xf1, 0x00, 0xcf, 0x38, 0x30,
0xfc, 0xb7, 0x9f, 0x7f, 0x00, 0x00, 0xfe, 0xf9, 0x01, 0xe7, 0x1f, 0xfe,
0xc3, 0xc0, 0x9f, 0xc3, 0x00, 0xcc, 0x1c, 0x30, 0xec, 0xff, 0xf9, 0xe1,
0x00, 0x00, 0xfc, 0xf0, 0x00, 0xc3, 0x0f, 0xfc, 0xc3, 0xc1, 0x0f, 0xc3,
0x00, 0xcc, 0x0e, 0x30, 0xcc, 0xfc, 0xf0, 0xc0, 0x00, 0xf0, 0x3f, 0xf0,
0x00, 0x03, 0xff, 0xcf, 0x80, 0xff, 0x03, 0xc3, 0x00, 0xcc, 0x07, 0x30,
0xcc, 0x3c, 0xf0, 0xc0, 0x00, 0xf8, 0x3f, 0xf0, 0x00, 0x03, 0xff, 0xcf,
0x00, 0xff, 0x03, 0xc3, 0x00, 0xcc, 0x07, 0x30, 0xcc, 0x3c, 0xf0, 0xc0,
0x00, 0x1c, 0x3c, 0xf0, 0xc0, 0x03, 0x0f, 0xc0, 0x00, 0xc0, 0x03, 0xc3,
0x30, 0xcc, 0x0e, 0x30, 0x0c, 0x3c, 0xf0, 0xc0, 0x00, 0x1c, 0x3c, 0xf8,
0xe1, 0x07, 0x1f, 0xc0, 0x00, 0xe0, 0x03, 0xc3, 0x70, 0xce, 0x1c, 0x30,
0x0c, 0x3c, 0xf0, 0xe1, 0x00, 0xf8, 0xff, 0x9f, 0x7f, 0xfe, 0xfb, 0xc3,
0x00, 0x7f, 0x03, 0xf3, 0xe3, 0xc7, 0x38, 0xfc, 0x0c, 0x3c, 0xb0, 0x7f,
0x00, 0xf0, 0xff, 0x0f, 0x3f, 0xfc, 0xf3, 0xc3, 0x00, 0x3f, 0x03, 0xf3,
0xc3, 0xc3, 0x30, 0xfc, 0x0c, 0x3c, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x30,
0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0xe0, 0x00, 0x03, 0x0c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0c, 0x30, 0xc0, 0x00, 0x07, 0x0e, 0xff, 0xf0, 0x3c, 0x0f,
0x3f, 0x3f, 0x0c, 0x3c, 0xf0, 0xc0, 0x03, 0x0f, 0xfc, 0x3f, 0x0c, 0x30,
0xc0, 0x00, 0x0e, 0x07, 0xff, 0xf9, 0xbd, 0x9f, 0x3f, 0x3f, 0x0c, 0x3c,
0xf0, 0xc0, 0x87, 0x0f, 0xfc, 0x3f, 0x0e, 0x30, 0xc0, 0x01, 0x9c, 0x03,
0x83, 0x1f, 0xff, 0xf9, 0x01, 0x0c, 0x0c, 0x3c, 0xf0, 0xc0, 0xce, 0x0d,
0x0c, 0x1c, 0x03, 0x30, 0x00, 0xf3, 0xfc, 0xf3, 0x83, 0x1f, 0xff, 0xf0,
0x01, 0x0c, 0x0c, 0x3c, 0xf0, 0xc0, 0xfc, 0x1c, 0x0c, 0x0e, 0x03, 0x30,
0x00, 0xf3, 0xfc, 0xf3, 0xff, 0xf9, 0x3f, 0x80, 0x3f, 0x0c, 0x0c, 0x3c,
0xf0, 0xc0, 0x78, 0xf8, 0x0f, 0x07, 0x0e, 0x30, 0xc0, 0x01, 0x9c, 0x03,
0xff, 0xf0, 0x3f, 0x00, 0x7f, 0x0c, 0x0c, 0x7c, 0xf8, 0xc0, 0x78, 0xf0,
0x8f, 0x03, 0x0c, 0x30, 0xc0, 0x00, 0x0e, 0x07, 0x03, 0x00, 0x3c, 0x00,
0xe0, 0x0c, 0x0f, 0xef, 0xdc, 0xcc, 0xfc, 0x00, 0xcc, 0x01, 0x0c, 0x30,
0xc0, 0x00, 0x07, 0x0e, 0x03, 0x00, 0x3c, 0x00, 0xe0, 0x9c, 0x9f, 0xcf,
0xcf, 0xff, 0xce, 0x01, 0xee, 0x00, 0x1c, 0x30, 0xe0, 0x00, 0x03, 0x0c,
0x03, 0x00, 0x3c, 0xc0, 0x7f, 0xf8, 0xf9, 0x8d, 0x87, 0x7f, 0x87, 0xf3,
0xf7, 0x3f, 0x38, 0x30, 0x70, 0x00, 0x00, 0x00, 0x03, 0x00, 0x3c, 0xc0,
0x3f, 0xf0, 0xf0, 0x0c, 0x03, 0x33, 0x03, 0xf3, 0xf3, 0x3f, 0x30, 0x30,
0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-14
View File
@@ -1,14 +0,0 @@
#define font_extra_dblsize_width 60
#define font_extra_dblsize_height 16
static unsigned char font_extra_dblsize_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x78, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfc, 0xc0, 0x80, 0xff, 0x00, 0x00, 0xff, 0x01, 0xce, 0xc1, 0x80, 0xff,
0x01, 0x80, 0xff, 0x01, 0x87, 0xc3, 0x00, 0xb0, 0x03, 0xc0, 0x0d, 0x00,
0x33, 0xc3, 0x00, 0x36, 0xc7, 0xe3, 0x6c, 0x00, 0x30, 0xc0, 0x00, 0x37,
0xce, 0x73, 0xec, 0x00, 0x30, 0xc0, 0x80, 0x33, 0xdc, 0x3b, 0xcc, 0x01,
0x30, 0xcc, 0xcc, 0x31, 0xd8, 0x1b, 0x8c, 0x03, 0x30, 0x1c, 0xee, 0x00,
0xc0, 0x03, 0x00, 0x07, 0x30, 0x38, 0x77, 0x00, 0xfe, 0x7f, 0x00, 0x0e,
0x30, 0xf0, 0x33, 0x00, 0xfe, 0x7f, 0x00, 0x0c, 0x30, 0xe0, 0x01, 0x00,
0x00, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-6
View File
@@ -1,6 +0,0 @@
#define font_extra_6x1_width 30
#define font_extra_6x1_height 8
static unsigned char font_extra_6x1_bits[] = {
0x84, 0x00, 0x00, 0x00, 0x8e, 0xf8, 0x00, 0x1f, 0x91, 0x40, 0x99, 0x02,
0x84, 0x50, 0x5a, 0x0a, 0x24, 0x4a, 0x18, 0x12, 0xc4, 0x05, 0xff, 0x20,
0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
-99
View File
@@ -1,99 +0,0 @@
#define doublefont_width 128
#define doublefont_height 72
static unsigned char doublefont_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0c, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x6c, 0x00, 0x10, 0xc2, 0x1c, 0x18,
0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x18, 0x6c, 0x6c,
0x7c, 0x67, 0x36, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
0x00, 0x18, 0x6c, 0x6c, 0xd6, 0x67, 0x36, 0x18, 0x18, 0x30, 0x00, 0x18,
0x00, 0x00, 0x00, 0x60, 0x00, 0x18, 0x00, 0xfe, 0x16, 0x32, 0x1e, 0x18,
0x0c, 0x60, 0x6c, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x18, 0x00, 0x6c,
0x1e, 0x18, 0x0c, 0x00, 0x0c, 0x60, 0x38, 0x18, 0x00, 0x00, 0x00, 0x18,
0x00, 0x18, 0x00, 0x6c, 0x7c, 0x18, 0x9e, 0x00, 0x0c, 0x60, 0xfe, 0xff,
0x00, 0xff, 0x00, 0x18, 0x00, 0x18, 0x00, 0xfe, 0xf0, 0x4c, 0xf3, 0x00,
0x0c, 0x60, 0x38, 0x18, 0x38, 0x00, 0x00, 0x0c, 0x00, 0x18, 0x00, 0x6c,
0xd0, 0xe6, 0x63, 0x00, 0x18, 0x30, 0x6c, 0x18, 0x38, 0x00, 0x00, 0x06,
0x00, 0x00, 0x00, 0x6c, 0xd6, 0xe6, 0x73, 0x00, 0x18, 0x30, 0x00, 0x18,
0x30, 0x00, 0x18, 0x06, 0x00, 0x18, 0x00, 0x00, 0x7c, 0x43, 0xde, 0x00,
0x30, 0x18, 0x00, 0x00, 0x30, 0x00, 0x3c, 0x03, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x60, 0x0c, 0x00, 0x00, 0x18, 0x00, 0x18, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c, 0x1e, 0x1e, 0x10, 0x3f, 0x1c, 0x3f,
0x1e, 0x1e, 0x00, 0x00, 0x60, 0x00, 0x06, 0x7c, 0x33, 0x0e, 0x33, 0x33,
0x18, 0x03, 0x36, 0x33, 0x33, 0x33, 0x18, 0x18, 0x30, 0x00, 0x0c, 0xc6,
0x33, 0x0f, 0x33, 0x33, 0x18, 0x03, 0x33, 0x1b, 0x33, 0x33, 0x3c, 0x3c,
0x18, 0x00, 0x18, 0xc6, 0x33, 0x0c, 0x30, 0x30, 0x1c, 0x1f, 0x03, 0x18,
0x33, 0x33, 0x18, 0x18, 0x0c, 0x00, 0x30, 0xc0, 0x33, 0x0c, 0x18, 0x1c,
0x1e, 0x33, 0x1f, 0x0c, 0x1e, 0x33, 0x00, 0x00, 0x06, 0xff, 0x60, 0x60,
0x33, 0x0c, 0x18, 0x30, 0x1b, 0x30, 0x33, 0x0c, 0x1e, 0x3e, 0x00, 0x00,
0x06, 0x00, 0x60, 0x30, 0x33, 0x0c, 0x0c, 0x30, 0x1b, 0x30, 0x33, 0x0c,
0x33, 0x30, 0x18, 0x38, 0x0c, 0x00, 0x30, 0x18, 0x33, 0x0c, 0x06, 0x33,
0x3f, 0x33, 0x33, 0x0c, 0x33, 0x33, 0x3c, 0x38, 0x18, 0xff, 0x18, 0x00,
0x33, 0x0c, 0x03, 0x33, 0x18, 0x33, 0x33, 0x0c, 0x33, 0x1b, 0x18, 0x30,
0x30, 0x00, 0x0c, 0x18, 0x1e, 0x3f, 0x3f, 0x1e, 0x18, 0x1e, 0x1e, 0x0c,
0x1e, 0x0e, 0x00, 0x30, 0x60, 0x00, 0x06, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x78, 0x18, 0x3f, 0x7c, 0x3f, 0xfe, 0xff, 0x7c,
0xc3, 0x7e, 0x78, 0xc3, 0x06, 0xc3, 0xc3, 0x3c, 0xcc, 0x3c, 0x63, 0xc6,
0x63, 0x06, 0x03, 0xc6, 0xc3, 0x18, 0x60, 0x63, 0x06, 0xe7, 0xc7, 0x66,
0xcc, 0x66, 0xc3, 0x83, 0xc3, 0x06, 0x03, 0x03, 0xc3, 0x18, 0x60, 0x33,
0x06, 0xff, 0xcf, 0xc3, 0x78, 0xc3, 0x63, 0x03, 0xc3, 0x06, 0x03, 0x03,
0xc3, 0x18, 0x60, 0x1b, 0x06, 0xdb, 0xcf, 0xc3, 0x00, 0xc3, 0x3f, 0x03,
0xc3, 0x7e, 0x3f, 0x03, 0xff, 0x18, 0x60, 0x0f, 0x06, 0xdb, 0xdb, 0xc3,
0x00, 0xc3, 0x63, 0x03, 0xc3, 0x06, 0x03, 0xe3, 0xc3, 0x18, 0x60, 0x0f,
0x06, 0xdb, 0xdb, 0xc3, 0x00, 0xff, 0xc3, 0x03, 0xc3, 0x06, 0x03, 0xc3,
0xc3, 0x18, 0x60, 0x1b, 0x06, 0xc3, 0xf3, 0xc3, 0x00, 0xc3, 0xc3, 0x83,
0xc3, 0x06, 0x03, 0xc3, 0xc3, 0x18, 0x62, 0x33, 0x06, 0xc3, 0xe3, 0xc3,
0x00, 0xc3, 0x63, 0xc6, 0x63, 0x06, 0x03, 0xc6, 0xc3, 0x18, 0x36, 0x63,
0x06, 0xc3, 0xe3, 0x66, 0x00, 0xc3, 0x3f, 0x7c, 0x3f, 0xfe, 0x03, 0x7c,
0xc3, 0x7e, 0x1c, 0xc3, 0xfe, 0xc3, 0xc3, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c,
0x00, 0x7c, 0x00, 0x00, 0x7f, 0x3c, 0x7f, 0x7e, 0xff, 0xc3, 0xc3, 0xc3,
0xc3, 0xc3, 0xfe, 0x0c, 0x03, 0x60, 0x18, 0x00, 0xc3, 0x66, 0xc3, 0xc3,
0x18, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc0, 0x0c, 0x06, 0x60, 0x3c, 0x00,
0xc3, 0xc3, 0xc3, 0x03, 0x18, 0xc3, 0xc3, 0xc3, 0x66, 0x66, 0xc0, 0x0c,
0x06, 0x60, 0x66, 0x00, 0xc3, 0xc3, 0xc3, 0x03, 0x18, 0xc3, 0x66, 0xc3,
0x3c, 0x3c, 0x60, 0x0c, 0x0c, 0x60, 0x42, 0x00, 0x7f, 0xc3, 0x7f, 0x7e,
0x18, 0xc3, 0x66, 0xdb, 0x18, 0x18, 0x30, 0x0c, 0x18, 0x60, 0x00, 0x00,
0x03, 0xc3, 0x1f, 0xc0, 0x18, 0xc3, 0x66, 0xdb, 0x18, 0x18, 0x18, 0x0c,
0x18, 0x60, 0x00, 0x00, 0x03, 0xdb, 0x33, 0xc0, 0x18, 0xc3, 0x3c, 0xdb,
0x3c, 0x18, 0x0c, 0x0c, 0x30, 0x60, 0x00, 0x00, 0x03, 0xf3, 0x63, 0xc0,
0x18, 0xc3, 0x3c, 0xff, 0x66, 0x18, 0x06, 0x0c, 0x60, 0x60, 0x00, 0x00,
0x03, 0x66, 0xc3, 0xc3, 0x18, 0x66, 0x18, 0xe7, 0xc3, 0x18, 0x06, 0x0c,
0x60, 0x60, 0x00, 0x00, 0x03, 0xbc, 0xc3, 0x7e, 0x18, 0x3c, 0x18, 0xc3,
0xc3, 0x18, 0xfe, 0x0c, 0xc0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x7c, 0x00, 0xff,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x60, 0x00, 0x38, 0x00,
0x03, 0x0c, 0x60, 0x06, 0x0e, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00,
0x60, 0x00, 0x6c, 0x00, 0x03, 0x0c, 0x60, 0x06, 0x0c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0x00, 0x60, 0x00, 0x6c, 0x00, 0x03, 0x00, 0x00, 0x06,
0x0c, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x1b, 0x3c, 0x6c, 0x1c, 0x0c, 0x5e,
0x1b, 0x0e, 0x78, 0x26, 0x0c, 0x35, 0x1b, 0x1c, 0x00, 0x66, 0x37, 0x66,
0x76, 0x36, 0x0c, 0x73, 0x37, 0x0c, 0x60, 0x36, 0x0c, 0x6b, 0x37, 0x36,
0x00, 0x60, 0x63, 0x03, 0x63, 0x63, 0x1f, 0x33, 0x63, 0x0c, 0x60, 0x1e,
0x0c, 0x6b, 0x63, 0x63, 0x00, 0x7e, 0x63, 0x03, 0x63, 0x7f, 0x0c, 0x1e,
0x63, 0x0c, 0x60, 0x0e, 0x0c, 0x6b, 0x63, 0x63, 0x00, 0x63, 0x63, 0x03,
0x63, 0x03, 0x0c, 0x03, 0x63, 0x0c, 0x63, 0x1e, 0x0c, 0x6b, 0x63, 0x63,
0x00, 0x73, 0x37, 0x66, 0x76, 0x66, 0x0c, 0x3e, 0x63, 0x0c, 0x63, 0x36,
0x0c, 0x6b, 0x63, 0x36, 0x00, 0x6e, 0x1b, 0x3c, 0x6c, 0x3c, 0x0c, 0x63,
0x63, 0x3f, 0x63, 0x66, 0x3f, 0x6b, 0x63, 0x1c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38,
0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0c, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x18, 0x08, 0x08,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
0x0c, 0x18, 0x10, 0x04, 0x1f, 0x7c, 0x3b, 0x3e, 0x3f, 0x63, 0x63, 0x63,
0x63, 0x63, 0x3f, 0x0c, 0x0c, 0x18, 0x20, 0x02, 0x33, 0x66, 0x6e, 0x63,
0x0c, 0x63, 0x63, 0x63, 0x36, 0x63, 0x30, 0x06, 0x0c, 0x30, 0x7f, 0x7f,
0x63, 0x63, 0x06, 0x03, 0x0c, 0x63, 0x36, 0x6b, 0x1c, 0x63, 0x18, 0x06,
0x0c, 0x30, 0x7f, 0x7f, 0x73, 0x67, 0x06, 0x3e, 0x0c, 0x63, 0x36, 0x6b,
0x08, 0x73, 0x0c, 0x0c, 0x0c, 0x18, 0x20, 0x02, 0x1f, 0x7c, 0x06, 0x60,
0x0c, 0x63, 0x1c, 0x6b, 0x1c, 0x6c, 0x06, 0x0c, 0x0c, 0x18, 0x10, 0x04,
0x03, 0x60, 0x06, 0x63, 0x6c, 0x76, 0x1c, 0x7f, 0x36, 0x60, 0x03, 0x0c,
0x0c, 0x18, 0x08, 0x08, 0x03, 0x60, 0x06, 0x3e, 0x38, 0x6c, 0x08, 0x36,
0x63, 0x33, 0x3f, 0x0c, 0x0c, 0x18, 0x00, 0x00, 0x03, 0x60, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x38, 0x00, 0x0e, 0x00, 0x00 };
-38
View File
@@ -1,38 +0,0 @@
#define font_small_width 80
#define font_small_height 42
static unsigned char font_small_bits[] = {
0x80, 0x28, 0x00, 0x02, 0x20, 0x44, 0x00, 0x00, 0x00, 0x00, 0x80, 0x28,
0xe5, 0x92, 0x20, 0x82, 0x28, 0x02, 0x00, 0x40, 0x80, 0xa8, 0x5f, 0x48,
0x21, 0x82, 0x10, 0x02, 0x00, 0x20, 0x80, 0x00, 0xe5, 0x84, 0x00, 0x82,
0xb8, 0x0f, 0x1e, 0x10, 0x00, 0x80, 0x4f, 0x53, 0x01, 0x82, 0x10, 0xc2,
0x80, 0x09, 0x80, 0x00, 0xe5, 0x90, 0x02, 0x44, 0x28, 0x42, 0x80, 0x01,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x84, 0x98,
0x47, 0x9e, 0x79, 0xc6, 0x00, 0x00, 0x00, 0x20, 0xca, 0x24, 0x64, 0x42,
0x40, 0x29, 0x19, 0x83, 0x80, 0x50, 0x8a, 0x20, 0x53, 0xce, 0x21, 0x26,
0x19, 0x43, 0x1e, 0x41, 0x8a, 0x10, 0xf4, 0x50, 0x22, 0xc9, 0x01, 0x20,
0x00, 0x22, 0x8a, 0x88, 0x44, 0x52, 0x12, 0x09, 0x19, 0x43, 0x1e, 0x01,
0xc4, 0x3d, 0x43, 0x8c, 0x11, 0xc6, 0x18, 0x81, 0x80, 0x20, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc4, 0x1c, 0x73, 0xde,
0x33, 0xc9, 0xa1, 0x14, 0x62, 0x32, 0x2a, 0xa5, 0x94, 0x42, 0x48, 0x89,
0xa0, 0x12, 0xf6, 0x4a, 0x24, 0x9d, 0x90, 0xce, 0x09, 0x8f, 0xa0, 0x11,
0xea, 0x4a, 0xe0, 0xa5, 0x90, 0x42, 0x68, 0x89, 0xa0, 0x11, 0x62, 0x4b,
0x20, 0xa5, 0x94, 0x42, 0x48, 0x89, 0xa4, 0x12, 0x62, 0x4b, 0x20, 0x1d,
0x73, 0x5e, 0x70, 0xc9, 0x99, 0xf4, 0x62, 0x32, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x1c, 0xe3, 0x52, 0x8a, 0x49,
0x3d, 0x07, 0x1c, 0x01, 0x29, 0xa5, 0x44, 0x52, 0x8a, 0x49, 0x21, 0x11,
0x90, 0x02, 0x29, 0x25, 0x41, 0x52, 0xaa, 0x46, 0x11, 0x21, 0x10, 0x00,
0x27, 0x1d, 0x42, 0x52, 0xfa, 0x86, 0x08, 0x41, 0x10, 0x00, 0x61, 0x95,
0x44, 0x92, 0xd9, 0x89, 0x04, 0x81, 0x10, 0x00, 0xc1, 0x24, 0x43, 0x8c,
0x89, 0x89, 0x3c, 0x07, 0x1c, 0x78, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x80, 0x00, 0x01, 0x81, 0xa0, 0x60,
0x00, 0x00, 0x04, 0x04, 0x80, 0x80, 0x02, 0x01, 0x80, 0x40, 0x00, 0x00,
0xc0, 0x1d, 0xe3, 0x8c, 0x70, 0xc7, 0xa0, 0x42, 0xd2, 0x31, 0x20, 0xa5,
0x90, 0xda, 0x49, 0x89, 0xa0, 0x41, 0x7e, 0x4a, 0xa0, 0xa5, 0x90, 0x86,
0x30, 0x89, 0xa0, 0x42, 0x6a, 0x4a, 0x40, 0x1d, 0xe3, 0x8c, 0x08, 0xc9,
0xa9, 0xe4, 0x6a, 0x32, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x44, 0x04, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x42, 0x88, 0x40, 0xc7, 0x1d,
0x77, 0x92, 0x8a, 0x29, 0x3d, 0x43, 0x18, 0x21, 0x29, 0xa5, 0x21, 0x92,
0xaa, 0x26, 0x11, 0x42, 0xc8, 0xf3, 0x29, 0x05, 0x26, 0x92, 0xfa, 0x46,
0x09, 0x42, 0x08, 0x21, 0xc7, 0x85, 0xc3, 0x1c, 0xd9, 0x89, 0x3c, 0x44,
0x84, 0x40, 0x01, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00 };
-6
View File
@@ -1,6 +0,0 @@
#define font_small_extra_width 30
#define font_small_extra_height 7
static unsigned char font_small_extra_bits[] = {
0x84, 0x00, 0x00, 0x00, 0x8e, 0xf8, 0x00, 0x1f, 0x91, 0x40, 0x99, 0x02,
0x24, 0x52, 0x5a, 0x0a, 0xc4, 0x49, 0x18, 0x12, 0x84, 0x04, 0xff, 0x20,
0x00, 0x00, 0x00, 0x00 };
-6
View File
@@ -1,6 +0,0 @@
#define font_tiny_width 39
#define font_tiny_height 5
static unsigned char font_tiny_bits[] = {
0x00, 0xa4, 0xbf, 0xff, 0x7f, 0x00, 0x3a, 0xb2, 0x09, 0x5b, 0x07, 0x2a,
0xf9, 0xbf, 0x7e, 0x00, 0xaa, 0x90, 0xac, 0x4a, 0x00, 0xf4, 0x9f, 0xbf,
0x7e };
+1 -1
View File
@@ -56,7 +56,7 @@ static const pm_uint8_t beepTab[] PROGMEM = {
void beep(uint8_t val)
{
#if defined(HAPTIC) && !defined(AUDIO)
haptic.event(val==0 ? AU_KEYPAD_UP : (val==4 ? AU_ERROR : AU_TIMER_10+beepAgain));
haptic.event(val==0 ? AU_KEYPAD_UP : (val==4 ? AU_ERROR : AU_TIMER_LT10+beepAgain));
#endif
#if !defined(AUDIO)
+1 -4
View File
@@ -70,8 +70,6 @@ void beep(uint8_t val);
#define AUDIO_TIMER_MINUTE(t) playDuration(t)
#define AUDIO_TIMER_30() PUSH_SYSTEM_PROMPT(AU_TIMER_30)
#define AUDIO_TIMER_20() PUSH_SYSTEM_PROMPT(AU_TIMER_20)
#define AUDIO_TIMER_10() PUSH_SYSTEM_PROMPT(AU_TIMER_10)
#define AUDIO_TIMER_LT3(x) PUSH_SYSTEM_PROMPT(AU_TIMER_LT3)
#else
#define AUDIO_TADA()
#define AUDIO_TX_BATTERY_LOW() beep(4)
@@ -80,8 +78,6 @@ void beep(uint8_t val);
#define AUDIO_TIMER_MINUTE(t) beep(2)
#define AUDIO_TIMER_30() { beepAgain=2; beep(2); }
#define AUDIO_TIMER_20() { beepAgain=1; beep(2); }
#define AUDIO_TIMER_10() beep(2)
#define AUDIO_TIMER_LT3(x) beep(2)
#endif
#define AUDIO_KEYPAD_UP() beep(0)
@@ -92,6 +88,7 @@ void beep(uint8_t val);
#define AUDIO_ERROR() beep(4)
#define AUDIO_MIX_WARNING(x) beep(1)
#define AUDIO_POT_STICK_MIDDLE() beep(2)
#define AUDIO_TIMER_LT10(x) beep(2)
#define AUDIO_VARIO_UP() _beep(1)
#define AUDIO_VARIO_DOWN() _beep(1)
#define AUDIO_TRIM(event, f) { if (!IS_KEY_FIRST(event)) warble = true; beep(1); }
+3 -3
View File
@@ -390,7 +390,7 @@ void eeLoadModel(uint8_t id)
for (uint8_t i=0; i<MAX_TIMERS; i++) {
if (g_model.timers[i].persistent) {
s_timerVal[i] = g_model.timers[i].value;
timersStates[i].val = g_model.timers[i].value;
}
}
@@ -470,8 +470,8 @@ void eeReadAll()
for (uint32_t i=0; i<MAX_MODELS; i++)
eeDeleteModel(i);
STORE_GENERALVARS;
STORE_MODELVARS;
eeDirty(EE_GENERAL);
eeDirty(EE_MODEL);
}
else {
eeLoadModelHeaders() ;
+2 -2
View File
@@ -527,7 +527,7 @@ bool RlcFile::copy(uint8_t i_fileDst, uint8_t i_fileSrc)
uint8_t buf[BS-sizeof(blkid_t)];
uint8_t len;
while ((len=theFile2.read(buf, BS-sizeof(blkid_t))))
while ((len=theFile2.read(buf, sizeof(buf))))
{
write(buf, len);
if (write_errno() != 0) {
@@ -958,7 +958,7 @@ void eeLoadModel(uint8_t id)
#if !defined(PCBSTD)
for (uint8_t i=0; i<MAX_TIMERS; i++) {
if (g_model.timers[i].persistent) {
s_timerVal[i] = g_model.timers[i].value;
timersStates[i].val = g_model.timers[i].value;
}
}
#endif
Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

+1
View File
@@ -0,0 +1 @@
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

+1
View File
@@ -0,0 +1 @@
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

+1
View File
@@ -0,0 +1 @@
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

+1
View File
@@ -0,0 +1 @@
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

+1
View File
@@ -0,0 +1 @@
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

+1
View File
@@ -0,0 +1 @@
0x3e,0x09,0x12,0x3d,0x00,0x3a,0x11,0x0a,0x39,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

+1
View File
@@ -0,0 +1 @@
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

+1
View File
@@ -0,0 +1 @@
0x18,0x36,0x2d,0x08,0x00,0x18,0x35,0x2e,0x08,0x00,0x18,0x25,0x16,0x3c,0x00,0x00,0x26,0x3d,0x22,0x00,0x00,0x4c,0x32,0x12,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

+1
View File
@@ -0,0 +1 @@
0xc0,0x01,0xe0,0x03,0xb4,0x06,0x96,0x04,0xb3,0x04,0xe1,0x06,0xc0,0x02,0x00,0x00,0xc0,0x01,0xe0,0x03,0xb1,0x06,0x93,0x04,0xb6,0x04,0xe4,0x06,0xc0,0x02,0x00,0x00,0x00,0x03,0xa0,0x07,0xb1,0x04,0x93,0x04,0x96,0x02,0xf4,0x07,0xe0,0x07,0x00,0x00,0x04,0x04,0x16,0x04,0xf3,0x07,0xf6,0x07,0x04,0x04,0x00,0x04,0x00,0x00,0xe0,0x00,0xf0,0x01,0x18,0x0b,0x08,0x0e,0x08,0x06,0x18,0x03,0x10,0x01,0x00,0x00,0x00,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

+1
View File
@@ -0,0 +1 @@
0x18,0x25,0x16,0x3c,0x00,0x1c,0x21,0x22,0x3c,0x00,
Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

+1
View File
@@ -0,0 +1 @@
0x20,0x55,0x56,0x54,0x78,0x3c,0x41,0x42,0x20,0x7c,
Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

+1
View File
@@ -0,0 +1 @@
0x00,0x03,0xa0,0x07,0xb2,0x04,0x96,0x04,0x94,0x02,0xf0,0x07,0xe0,0x07,0x00,0x00,0xf0,0x01,0xf0,0x03,0x02,0x06,0x06,0x04,0x04,0x02,0xf0,0x07,0xf0,0x07,0x00,0x00,

Some files were not shown because too many files have changed in this diff Show More