Compare commits
200 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23b9a757e4 | |||
| 65fdb1a64b | |||
| 05fb10b7e3 | |||
| 3a359b2075 | |||
| 01fe85f969 | |||
| 7b00d70cac | |||
| d56492403d | |||
| a26ee86101 | |||
| 509399ad04 | |||
| b444e857d7 | |||
| 35f3ce021f | |||
| 05c55592f5 | |||
| 6968b552ea | |||
| 566fc2344b | |||
| 89c1962c5f | |||
| 511b63d604 | |||
| 1839ff7dcc | |||
| e8822c805f | |||
| 19d1238ab6 | |||
| 7db61e7385 | |||
| badff8ff1c | |||
| 981e402e68 | |||
| 50c7a8b5db | |||
| b941aa0277 | |||
| 4a8f1281d4 | |||
| 3f9c37bb15 | |||
| bd1f7b332d | |||
| f3d38ab8e2 | |||
| bd166cae99 | |||
| e8a2942895 | |||
| d144b2dc05 | |||
| 3cbad08e50 | |||
| ed61d18878 | |||
| 34b6c5bc3b | |||
| 35837548de | |||
| 4c92ad1da8 | |||
| a548818523 | |||
| 47723faaeb | |||
| a366053b72 | |||
| 9c1761972a | |||
| 0d64e6b3c7 | |||
| 2b3fe0f752 | |||
| 7ef4fc4594 | |||
| 6e04ee65ee | |||
| 8312989282 | |||
| 32a2943a83 | |||
| 7501f9c403 | |||
| 0f2d097a43 | |||
| 0cb22c6cf2 | |||
| 57c3a19e8e | |||
| 9a79ea4919 | |||
| e97af2fb23 | |||
| a7c26a4514 | |||
| a19970c0ca | |||
| b362bc7f9d | |||
| a03c3a849d | |||
| 6442950fc2 | |||
| 750922b698 | |||
| 0abbfa5f8e | |||
| 3b491cdf82 | |||
| 0f00dc3e16 | |||
| 75ce4c2afa | |||
| b15030afc3 | |||
| b1389ee87a | |||
| 4035b82831 | |||
| 8bac09c126 | |||
| 381af741fb | |||
| 2d3215466f | |||
| c924a369d7 | |||
| a9208deb91 | |||
| d0156700f5 | |||
| 475b8bc3e6 | |||
| d796623e3a | |||
| e5595cfdce | |||
| 442264199f | |||
| ea4ffb99b0 | |||
| 9cb49d7f83 | |||
| 4c34d8aaff | |||
| 1f31c60c82 | |||
| 7ecc01672f | |||
| 67b6a82671 | |||
| 5ee5fa7e98 | |||
| e86aa51a22 | |||
| e25200b45e | |||
| d91b8ecd0b | |||
| 288a697264 | |||
| 432ee0f337 | |||
| 7534e58bbd | |||
| 5e6c32b929 | |||
| 0e441c1baf | |||
| 0f3b5d8fd7 | |||
| 9b0b2d078c | |||
| 7fef965b08 | |||
| fc4a41a689 | |||
| 836cadcb13 | |||
| f65e99504c | |||
| b7be29b9ca | |||
| 761eb7add1 | |||
| f4a3d199b9 | |||
| 318abd2667 | |||
| 171c77ff64 | |||
| 82ffb34ec2 | |||
| 5a157471fd | |||
| e416fa4871 | |||
| 72aaae0b4a | |||
| 0f3928743c | |||
| f6d1986b5c | |||
| d597c5d653 | |||
| ec970f7dfa | |||
| 43e18379ee | |||
| 2f5fcfcc01 | |||
| 5d484a3eff | |||
| 5973057d7b | |||
| 76ee88eb4c | |||
| bfe67b39f5 | |||
| 3639ec807d | |||
| ba51df10f2 | |||
| 2a2840eb14 | |||
| d38c32544c | |||
| 8b37174008 | |||
| 66b810b7ad | |||
| ed55931f77 | |||
| a92f0b3c72 | |||
| fea4145271 | |||
| 5e5b093a2f | |||
| 190100b8e2 | |||
| bd7e6d8637 | |||
| 77409ec7d8 | |||
| 10049de852 | |||
| 24ee0f03e9 | |||
| bc8cfe5a04 | |||
| b66577deb5 | |||
| aff9a411b9 | |||
| fd042add99 | |||
| 7d452e798b | |||
| f79e2aba4f | |||
| 46ae2e434a | |||
| 4c01fa5ccd | |||
| 8270bdabdb | |||
| 7ec7428da8 | |||
| 9016e8dc79 | |||
| 2ec67683ec | |||
| a6c9883383 | |||
| 1c695a05d7 | |||
| f4d3759e8a | |||
| cbe3a02fb9 | |||
| ab37f82825 | |||
| 5701c029db | |||
| 01033837da | |||
| 29b941539b | |||
| 63407597c5 | |||
| c246dc27ce | |||
| 62326a67ce | |||
| b58dcc9824 | |||
| 4b014c163b | |||
| f4bdc3888e | |||
| 86a7429f51 | |||
| fc1349fb75 | |||
| d0c4ddd064 | |||
| 6e14b9ee63 | |||
| a861ab1dfd | |||
| dc36a83cf5 | |||
| 855c3b6a6c | |||
| 4215d5b55d | |||
| cec998133f | |||
| 718d055cbc | |||
| e589f91d45 | |||
| bb3751bb9a | |||
| d5f19c0da7 | |||
| c84501fbd1 | |||
| 784bab30b1 | |||
| b2247dc943 | |||
| d3704b1c1f | |||
| 46d157f0a4 | |||
| 46b46b7c52 | |||
| b2824994aa | |||
| 0ac385eed0 | |||
| cf578bbaa0 | |||
| 6427b8a8bb | |||
| ffe29e6f1a | |||
| dd7e9ae2b4 | |||
| 6dc8eb75a2 | |||
| a8f99b1b61 | |||
| c9171c6d79 | |||
| 7e7b1914ff | |||
| cf3da300b5 | |||
| f7c207547f | |||
| 61b8f4b4e4 | |||
| 3a8220a4bb | |||
| ad653ecd0f | |||
| b593317360 | |||
| 40b42a4171 | |||
| 1ee7247576 | |||
| 98456f9489 | |||
| 3492b5d0a6 | |||
| 1aff10dc35 | |||
| 33fff62c0c | |||
| 1042f3ea2e | |||
| 6a3b539a22 | |||
| edb07e2c56 |
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) }
|
||||
}
|
||||
@@ -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 $< > $@
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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,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 $< > $@
|
||||
|
||||
@@ -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 = .;
|
||||
@@ -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_ */
|
||||
@@ -1,4 +1,4 @@
|
||||
FatFs Module Source Files R0.09 (C)ChaN, 2011
|
||||
FatFs Module Source Files R0.09b (C)ChaN, 2013
|
||||
|
||||
|
||||
FILES
|
||||
@@ -7,7 +7,8 @@ FILES
|
||||
ff.h Common include file for FatFs and application module.
|
||||
ff.c FatFs module.
|
||||
diskio.h Common include file for FatFs and disk I/O module.
|
||||
integer.h Alternative type definitions for integer variables.
|
||||
diskio.c An example of glue function to attach existing disk I/O module to FatFs.
|
||||
integer.h Integer type definitions for FatFs.
|
||||
option Optional external functions.
|
||||
|
||||
Low level disk I/O module is not included in this archive because the FatFs
|
||||
@@ -23,7 +24,7 @@ AGREEMENTS
|
||||
small embedded systems. This is a free software and is opened for education,
|
||||
research and commercial developments under license policy of following trems.
|
||||
|
||||
Copyright (C) 2011, ChaN, all right reserved.
|
||||
Copyright (C) 2012, ChaN, all right reserved.
|
||||
|
||||
* The FatFs module is a free software and there is NO WARRANTY.
|
||||
* No restriction on use. You can use, modify and redistribute it for
|
||||
@@ -128,3 +129,10 @@ REVISION HISTORY
|
||||
|
||||
Sep 06,'11 R0.09 f_mkfs() supports multiple partition to finish the multiple partition feature.
|
||||
Added f_fdisk(). (_MULTI_PARTITION = 2)
|
||||
|
||||
Aug 27,'12 R0.09a Fixed assertion failure due to OS/2 EA on FAT12/16.
|
||||
Changed f_open() and f_opendir() reject null object pointer to avoid crash.
|
||||
Changed option name _FS_SHARE to _FS_LOCK.
|
||||
|
||||
Jan 23,'13 R0.09b Added f_getlabel() and f_setlabel(). (_USE_LABEL == 1)
|
||||
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
/*-----------------------------------------------------------------------
|
||||
/ Low level disk interface modlue include file
|
||||
/ Low level disk interface modlue include file (C)ChaN, 2013
|
||||
/-----------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _DISKIO
|
||||
#ifndef _DISKIO_DEFINED
|
||||
#define _DISKIO_DEFINED
|
||||
|
||||
#define _READONLY 0 /* 1: Remove write functions */
|
||||
#define _USE_IOCTL 1 /* 1: Use disk_ioctl fucntion */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define _USE_WRITE 1 /* 1: Enable disk_write function */
|
||||
#define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */
|
||||
|
||||
#include "integer.h"
|
||||
|
||||
@@ -26,26 +31,15 @@ typedef enum {
|
||||
/*---------------------------------------*/
|
||||
/* Prototypes for disk control functions */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int assign_drives (int, int);
|
||||
DSTATUS disk_initialize (BYTE);
|
||||
DSTATUS disk_status (BYTE);
|
||||
DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
|
||||
#if _READONLY == 0
|
||||
DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
|
||||
#endif
|
||||
DRESULT disk_ioctl (BYTE, BYTE, void*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
DSTATUS disk_initialize (BYTE pdrv);
|
||||
DSTATUS disk_status (BYTE pdrv);
|
||||
DRESULT disk_read (BYTE pdrv, BYTE*buff, DWORD sector, BYTE count);
|
||||
DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, BYTE count);
|
||||
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
|
||||
|
||||
|
||||
/* Disk Status Bits (DSTATUS) */
|
||||
|
||||
#define STA_NOINIT 0x01 /* Drive not initialized */
|
||||
#define STA_NODISK 0x02 /* No medium in the drive */
|
||||
#define STA_PROTECT 0x04 /* Write protected */
|
||||
@@ -53,17 +47,18 @@ DRESULT disk_ioctl (BYTE, BYTE, void*);
|
||||
|
||||
/* Command code for disk_ioctrl fucntion */
|
||||
|
||||
/* Generic command (defined for FatFs) */
|
||||
/* Generic command (used by FatFs) */
|
||||
#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
|
||||
#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
|
||||
#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
|
||||
#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
|
||||
#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
|
||||
|
||||
/* Generic command */
|
||||
/* Generic command (not used by FatFs) */
|
||||
#define CTRL_POWER 5 /* Get/Set power status */
|
||||
#define CTRL_LOCK 6 /* Lock/Unlock media removal */
|
||||
#define CTRL_EJECT 7 /* Eject media */
|
||||
#define CTRL_FORMAT 8 /* Create physical format on the media */
|
||||
|
||||
/* MMC/SDC specific ioctl command */
|
||||
#define MMC_GET_TYPE 10 /* Get card type */
|
||||
@@ -77,9 +72,17 @@ DRESULT disk_ioctl (BYTE, BYTE, void*);
|
||||
#define ATA_GET_MODEL 21 /* Get model name */
|
||||
#define ATA_GET_SN 22 /* Get serial number */
|
||||
|
||||
/* NAND specific ioctl command */
|
||||
#define NAND_FORMAT 30 /* Create physical format */
|
||||
|
||||
/* MMC card type flags (MMC_GET_TYPE) */
|
||||
#define CT_MMC 0x01 /* MMC ver 3 */
|
||||
#define CT_SD1 0x02 /* SD ver 1 */
|
||||
#define CT_SD2 0x04 /* SD ver 2 */
|
||||
#define CT_SDC (CT_SD1|CT_SD2) /* SD */
|
||||
#define CT_BLOCK 0x08 /* Block addressing */
|
||||
|
||||
|
||||
#define _DISKIO
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/*---------------------------------------------------------------------------/
|
||||
/ FatFs - FAT file system module include file R0.09 (C)ChaN, 2011
|
||||
/ FatFs - FAT file system module include file R0.09b (C)ChaN, 2013
|
||||
/----------------------------------------------------------------------------/
|
||||
/ FatFs module is a generic FAT file system module for small embedded systems.
|
||||
/ This is a free software that opened for education, research and commercial
|
||||
/ developments under license policy of following trems.
|
||||
/ developments under license policy of following terms.
|
||||
/
|
||||
/ Copyright (C) 2011, ChaN, all right reserved.
|
||||
/ Copyright (C) 2013, ChaN, all right reserved.
|
||||
/
|
||||
/ * The FatFs module is a free software and there is NO WARRANTY.
|
||||
/ * No restriction on use. You can use, modify and redistribute it for
|
||||
@@ -15,7 +15,7 @@
|
||||
/----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _FATFS
|
||||
#define _FATFS 6502 /* Revision ID */
|
||||
#define _FATFS 82786 /* Revision ID */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -41,9 +41,9 @@ extern PARTITION VolToPart[]; /* Volume - Partition resolution table */
|
||||
#define LD2PD(vol) (VolToPart[vol].pd) /* Get physical drive number */
|
||||
#define LD2PT(vol) (VolToPart[vol].pt) /* Get partition index */
|
||||
|
||||
#else /* Single partition configuration */
|
||||
#define LD2PD(vol) (vol) /* Each logical drive is bound to the same physical drive number */
|
||||
#define LD2PT(vol) 0 /* Always mounts the 1st partition or in SFD */
|
||||
#else /* Single partition configuration */
|
||||
#define LD2PD(vol) (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */
|
||||
#define LD2PT(vol) 0 /* Always mounts the 1st partition or in SFD */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -99,6 +99,7 @@ typedef struct {
|
||||
#endif
|
||||
DWORD n_fatent; /* Number of FAT entries (= number of clusters + 2) */
|
||||
DWORD fsize; /* Sectors per FAT */
|
||||
DWORD volbase; /* Volume start sector */
|
||||
DWORD fatbase; /* FAT start sector */
|
||||
DWORD dirbase; /* Root directory start sector (FAT32:Cluster#) */
|
||||
DWORD database; /* Data start sector */
|
||||
@@ -111,24 +112,24 @@ typedef struct {
|
||||
/* File object structure (FIL) */
|
||||
|
||||
typedef struct {
|
||||
FATFS* fs; /* Pointer to the owner file system object */
|
||||
WORD id; /* Owner file system mount ID */
|
||||
FATFS* fs; /* Pointer to the related file system object (**do not change order**) */
|
||||
WORD id; /* Owner file system mount ID (**do not change order**) */
|
||||
BYTE flag; /* File status flags */
|
||||
BYTE pad1;
|
||||
DWORD fptr; /* File read/write pointer (0 on file open) */
|
||||
DWORD fptr; /* File read/write pointer (0ed on file open) */
|
||||
DWORD fsize; /* File size */
|
||||
DWORD sclust; /* File start cluster (0 when fsize==0) */
|
||||
DWORD clust; /* Current cluster */
|
||||
DWORD dsect; /* Current data sector */
|
||||
DWORD sclust; /* File data start cluster (0:no data cluster, always 0 when fsize is 0) */
|
||||
DWORD clust; /* Current cluster of fpter */
|
||||
DWORD dsect; /* Current data sector of fpter */
|
||||
#if !_FS_READONLY
|
||||
DWORD dir_sect; /* Sector containing the directory entry */
|
||||
BYTE* dir_ptr; /* Ponter to the directory entry in the window */
|
||||
BYTE* dir_ptr; /* Pointer to the directory entry in the window */
|
||||
#endif
|
||||
#if _USE_FASTSEEK
|
||||
DWORD* cltbl; /* Pointer to the cluster link map table (null on file open) */
|
||||
#endif
|
||||
#if _FS_SHARE
|
||||
UINT lockid; /* File lock ID (index of file semaphore table) */
|
||||
#if _FS_LOCK
|
||||
UINT lockid; /* File lock ID (index of file semaphore table Files[]) */
|
||||
#endif
|
||||
#if !_FS_TINY
|
||||
BYTE buf[_MAX_SS]; /* File data read/write buffer */
|
||||
@@ -140,8 +141,8 @@ typedef struct {
|
||||
/* Directory object structure (DIR) */
|
||||
|
||||
typedef struct {
|
||||
FATFS* fs; /* Pointer to the owner file system object */
|
||||
WORD id; /* Owner file system mount ID */
|
||||
FATFS* fs; /* Pointer to the owner file system object (**do not change order**) */
|
||||
WORD id; /* Owner file system mount ID (**do not change order**) */
|
||||
WORD index; /* Current read/write index number */
|
||||
DWORD sclust; /* Table start cluster (0:Root dir) */
|
||||
DWORD clust; /* Current cluster */
|
||||
@@ -176,14 +177,14 @@ typedef struct {
|
||||
|
||||
typedef enum {
|
||||
FR_OK = 0, /* (0) Succeeded */
|
||||
FR_DISK_ERR, /* (1) A hard error occured in the low level disk I/O layer */
|
||||
FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */
|
||||
FR_INT_ERR, /* (2) Assertion failed */
|
||||
FR_NOT_READY, /* (3) The physical drive cannot work */
|
||||
FR_NO_FILE, /* (4) Could not find the file */
|
||||
FR_NO_PATH, /* (5) Could not find the path */
|
||||
FR_INVALID_NAME, /* (6) The path name format is invalid */
|
||||
FR_DENIED, /* (7) Acces denied due to prohibited access or directory full */
|
||||
FR_EXIST, /* (8) Acces denied due to prohibited access */
|
||||
FR_DENIED, /* (7) Access denied due to prohibited access or directory full */
|
||||
FR_EXIST, /* (8) Access denied due to prohibited access */
|
||||
FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */
|
||||
FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */
|
||||
FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */
|
||||
@@ -191,7 +192,7 @@ typedef enum {
|
||||
FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */
|
||||
FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any parameter error */
|
||||
FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */
|
||||
FR_LOCKED, /* (16) The operation is rejected according to the file shareing policy */
|
||||
FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */
|
||||
FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */
|
||||
FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > _FS_SHARE */
|
||||
FR_INVALID_PARAMETER /* (19) Given parameter is invalid */
|
||||
@@ -202,33 +203,35 @@ typedef enum {
|
||||
/*--------------------------------------------------------------*/
|
||||
/* FatFs module application interface */
|
||||
|
||||
FRESULT f_mount (BYTE, FATFS*); /* Mount/Unmount a logical drive */
|
||||
FRESULT f_open (FIL*, const TCHAR*, BYTE); /* Open or create a file */
|
||||
FRESULT f_read (FIL*, void*, UINT, UINT*); /* Read data from a file */
|
||||
FRESULT f_lseek (FIL*, DWORD); /* Move file pointer of a file object */
|
||||
FRESULT f_close (FIL*); /* Close an open file object */
|
||||
FRESULT f_opendir (DIR*, const TCHAR*); /* Open an existing directory */
|
||||
FRESULT f_readdir (DIR*, FILINFO*); /* Read a directory item */
|
||||
FRESULT f_stat (const TCHAR*, FILINFO*); /* Get file status */
|
||||
FRESULT f_write (FIL*, const void*, UINT, UINT*); /* Write data to a file */
|
||||
FRESULT f_getfree (const TCHAR*, DWORD*, FATFS**); /* Get number of free clusters on the drive */
|
||||
FRESULT f_truncate (FIL*); /* Truncate file */
|
||||
FRESULT f_sync (FIL*); /* Flush cached data of a writing file */
|
||||
FRESULT f_unlink (const TCHAR*); /* Delete an existing file or directory */
|
||||
FRESULT f_mkdir (const TCHAR*); /* Create a new directory */
|
||||
FRESULT f_chmod (const TCHAR*, BYTE, BYTE); /* Change attriburte of the file/dir */
|
||||
FRESULT f_utime (const TCHAR*, const FILINFO*); /* Change timestamp of the file/dir */
|
||||
FRESULT f_rename (const TCHAR*, const TCHAR*); /* Rename/Move a file or directory */
|
||||
FRESULT f_chdrive (BYTE); /* Change current drive */
|
||||
FRESULT f_chdir (const TCHAR*); /* Change current directory */
|
||||
FRESULT f_getcwd (TCHAR*, UINT); /* Get current directory */
|
||||
FRESULT f_forward (FIL*, UINT(*)(const BYTE*,UINT), UINT, UINT*); /* Forward data to the stream */
|
||||
FRESULT f_mkfs (BYTE, BYTE, UINT); /* Create a file system on the drive */
|
||||
FRESULT f_fdisk (BYTE, const DWORD[], void*); /* Divide a physical drive into some partitions */
|
||||
int f_putc (TCHAR, FIL*); /* Put a character to the file */
|
||||
int f_puts (const TCHAR*, FIL*); /* Put a string to the file */
|
||||
int f_printf (FIL*, const TCHAR*, ...); /* Put a formatted string to the file */
|
||||
TCHAR* f_gets (TCHAR*, int, FIL*); /* Get a string from the file */
|
||||
FRESULT f_mount (BYTE vol, FATFS* fs); /* Mount/Unmount a logical drive */
|
||||
FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode); /* Open or create a file */
|
||||
FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br); /* Read data from a file */
|
||||
FRESULT f_lseek (FIL* fp, DWORD ofs); /* Move file pointer of a file object */
|
||||
FRESULT f_close (FIL* fp); /* Close an open file object */
|
||||
FRESULT f_opendir (DIR* dj, const TCHAR* path); /* Open an existing directory */
|
||||
FRESULT f_readdir (DIR* dj, FILINFO* fno); /* Read a directory item */
|
||||
FRESULT f_stat (const TCHAR* path, FILINFO* fno); /* Get file status */
|
||||
FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw); /* Write data to a file */
|
||||
FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs); /* Get number of free clusters on the drive */
|
||||
FRESULT f_truncate (FIL* fp); /* Truncate file */
|
||||
FRESULT f_sync (FIL* fp); /* Flush cached data of a writing file */
|
||||
FRESULT f_unlink (const TCHAR* path); /* Delete an existing file or directory */
|
||||
FRESULT f_mkdir (const TCHAR* path); /* Create a new directory */
|
||||
FRESULT f_chmod (const TCHAR* path, BYTE value, BYTE mask); /* Change attribute of the file/dir */
|
||||
FRESULT f_utime (const TCHAR* path, const FILINFO* fno); /* Change times-tamp of the file/dir */
|
||||
FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */
|
||||
FRESULT f_chdrive (BYTE drv); /* Change current drive */
|
||||
FRESULT f_chdir (const TCHAR* path); /* Change current directory */
|
||||
FRESULT f_getcwd (TCHAR* buff, UINT len); /* Get current directory */
|
||||
FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* sn); /* Get volume label */
|
||||
FRESULT f_setlabel (const TCHAR* label); /* Set volume label */
|
||||
FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */
|
||||
FRESULT f_mkfs (BYTE vol, BYTE sfd, UINT au); /* Create a file system on the drive */
|
||||
FRESULT f_fdisk (BYTE pdrv, const DWORD szt[], void* work); /* Divide a physical drive into some partitions */
|
||||
int f_putc (TCHAR c, FIL* fp); /* Put a character to the file */
|
||||
int f_puts (const TCHAR* str, FIL* cp); /* Put a string to the file */
|
||||
int f_printf (FIL* fp, const TCHAR* str, ...); /* Put a formatted string to the file */
|
||||
TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */
|
||||
|
||||
#define f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
|
||||
#define f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
|
||||
@@ -251,21 +254,21 @@ DWORD get_fattime (void);
|
||||
#endif
|
||||
|
||||
/* Unicode support functions */
|
||||
#if _USE_LFN /* Unicode - OEM code conversion */
|
||||
WCHAR ff_convert (WCHAR, UINT); /* OEM-Unicode bidirectional conversion */
|
||||
WCHAR ff_wtoupper (WCHAR); /* Unicode upper-case conversion */
|
||||
#if _USE_LFN == 3 /* Memory functions */
|
||||
void* ff_memalloc (UINT); /* Allocate memory block */
|
||||
void ff_memfree (void*); /* Free memory block */
|
||||
#if _USE_LFN /* Unicode - OEM code conversion */
|
||||
WCHAR ff_convert (WCHAR chr, UINT dir); /* OEM-Unicode bidirectional conversion */
|
||||
WCHAR ff_wtoupper (WCHAR chr); /* Unicode upper-case conversion */
|
||||
#if _USE_LFN == 3 /* Memory functions */
|
||||
void* ff_memalloc (UINT msize); /* Allocate memory block */
|
||||
void ff_memfree (void* mblock); /* Free memory block */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Sync functions */
|
||||
#if _FS_REENTRANT
|
||||
int ff_cre_syncobj (BYTE, _SYNC_t*);/* Create a sync object */
|
||||
int ff_req_grant (_SYNC_t); /* Lock sync object */
|
||||
void ff_rel_grant (_SYNC_t); /* Unlock sync object */
|
||||
int ff_del_syncobj (_SYNC_t); /* Delete a sync object */
|
||||
int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj); /* Create a sync object */
|
||||
int ff_req_grant (_SYNC_t sobj); /* Lock sync object */
|
||||
void ff_rel_grant (_SYNC_t sobj); /* Unlock sync object */
|
||||
int ff_del_syncobj (_SYNC_t sobj); /* Delete a sync object */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*---------------------------------------------------------------------------/
|
||||
/ FatFs - FAT file system module configuration file R0.09 (C)ChaN, 2011
|
||||
/ FatFs - FAT file system module configuration file R0.09b (C)ChaN, 2013
|
||||
/----------------------------------------------------------------------------/
|
||||
/
|
||||
/ CAUTION! Do not forget to make clean the project after any changes to
|
||||
@@ -7,7 +7,7 @@
|
||||
/
|
||||
/----------------------------------------------------------------------------*/
|
||||
#ifndef _FFCONF
|
||||
#define _FFCONF 6502 /* Revision ID */
|
||||
#define _FFCONF 82786 /* Revision ID */
|
||||
|
||||
#if defined(CPUARM) && !defined(SIMU)
|
||||
#ifdef __cplusplus
|
||||
@@ -53,14 +53,17 @@ extern "C" {
|
||||
/* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
|
||||
|
||||
|
||||
#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
|
||||
/* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
|
||||
|
||||
|
||||
#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
|
||||
/* To enable fast seek feature, set _USE_FASTSEEK to 1. */
|
||||
|
||||
|
||||
#define _USE_LABEL 0 /* 0:Disable or 1:Enable */
|
||||
/* To enable volume label functions, set _USE_LAVEL to 1 */
|
||||
|
||||
|
||||
#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
|
||||
/* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------/
|
||||
/ Locale and Namespace Configurations
|
||||
@@ -99,11 +102,11 @@ extern "C" {
|
||||
*/
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define _USE_LFN 2 /* 0 to 3 */
|
||||
#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
|
||||
#define _USE_LFN 2 /* 0 to 3 */
|
||||
#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
|
||||
#else
|
||||
#define _USE_LFN 1 /* 0 to 3 */
|
||||
#define _MAX_LFN 32 /* Maximum LFN length to handle (12 to 255) */
|
||||
#define _USE_LFN 1 /* 0 to 3 */
|
||||
#define _MAX_LFN 32 /* Maximum LFN length to handle (12 to 255) */
|
||||
#endif
|
||||
|
||||
/* The _USE_LFN option switches the LFN support.
|
||||
@@ -124,7 +127,7 @@ extern "C" {
|
||||
/ enable LFN feature and set _LFN_UNICODE to 1. */
|
||||
|
||||
|
||||
#define _FS_RPATH 2 /* 0 to 2 */
|
||||
#define _FS_RPATH 2 /* 0 to 2 */
|
||||
/* The _FS_RPATH option configures relative path feature.
|
||||
/
|
||||
/ 0: Disable relative path feature and remove related functions.
|
||||
@@ -134,7 +137,6 @@ extern "C" {
|
||||
/ Note that output of the f_readdir fnction is affected by this option. */
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------/
|
||||
/ Physical Drive Configurations
|
||||
/----------------------------------------------------------------------------*/
|
||||
@@ -151,7 +153,7 @@ extern "C" {
|
||||
/ and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */
|
||||
|
||||
|
||||
#define _MULTI_PARTITION 0 /* 0:Single partition, 1/2:Enable multiple partition */
|
||||
#define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
|
||||
/* When set to 0, each volume is bound to the same physical drive number and
|
||||
/ it can mount only first primaly partition. When it is set to 1, each volume
|
||||
/ is tied to the partitions listed in VolToPart[]. */
|
||||
@@ -185,12 +187,13 @@ extern "C" {
|
||||
/ windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define _FS_REENTRANT 1 /* 0:Disable or 1:Enable */
|
||||
#define _FS_REENTRANT 1 /* 0:Disable or 1:Enable */
|
||||
#define _SYNC_t unsigned char /*OS_MutexID*/ /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
|
||||
#else
|
||||
#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
|
||||
#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
|
||||
#endif
|
||||
|
||||
#define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */
|
||||
#define _SYNC_t OS_MutexID /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
|
||||
|
||||
/* The _FS_REENTRANT option switches the reentrancy (thread safe) of the FatFs module.
|
||||
/
|
||||
@@ -199,10 +202,10 @@ extern "C" {
|
||||
/ ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj
|
||||
/ function must be added to the project. */
|
||||
|
||||
#define _FS_SHARE 0 /* 0:Disable or >=1:Enable */
|
||||
|
||||
/* To enable file shareing feature, set _FS_SHARE to 1 or greater. The value
|
||||
defines how many files can be opened simultaneously. */
|
||||
#define _FS_LOCK 0 /* 0:Disable or >=1:Enable */
|
||||
/* To enable file lock control feature, set _FS_LOCK to 1 or greater.
|
||||
The value defines how many files can be opened simultaneously. */
|
||||
|
||||
|
||||
#endif /* _FFCONFIG */
|
||||
|
||||
@@ -3724,7 +3724,7 @@ const WCHAR sjis2uni[] = {
|
||||
|
||||
|
||||
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
WCHAR src, /* Character code to be converted */
|
||||
WCHAR chr, /* Character code to be converted */
|
||||
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
|
||||
)
|
||||
{
|
||||
@@ -3733,8 +3733,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
int i, n, li, hi;
|
||||
|
||||
|
||||
if (src <= 0x80) { /* ASCII */
|
||||
c = src;
|
||||
if (chr <= 0x80) { /* ASCII */
|
||||
c = chr;
|
||||
} else {
|
||||
#if !_TINY_TABLE
|
||||
if (dir) { /* OEMCP to unicode */
|
||||
@@ -3747,8 +3747,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
li = 0;
|
||||
for (n = 16; n; n--) {
|
||||
i = li + (hi - li) / 2;
|
||||
if (src == p[i * 2]) break;
|
||||
if (src > p[i * 2])
|
||||
if (chr == p[i * 2]) break;
|
||||
if (chr > p[i * 2])
|
||||
li = i;
|
||||
else
|
||||
hi = i;
|
||||
@@ -3760,15 +3760,15 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
do {
|
||||
c = *p;
|
||||
p += 2;
|
||||
} while (c && c != src);
|
||||
} while (c && c != chr);
|
||||
p -= 3;
|
||||
c = *p;
|
||||
} else { /* Unicode to OEMCP */
|
||||
li = 0; hi = sizeof(uni2sjis) / 4 - 1;
|
||||
for (n = 16; n; n--) {
|
||||
i = li + (hi - li) / 2;
|
||||
if (src == uni2sjis[i * 2]) break;
|
||||
if (src > uni2sjis[i * 2])
|
||||
if (chr == uni2sjis[i * 2]) break;
|
||||
if (chr > uni2sjis[i * 2])
|
||||
li = i;
|
||||
else
|
||||
hi = i;
|
||||
|
||||
@@ -10922,7 +10922,7 @@ const WCHAR oem2uni[] = {
|
||||
|
||||
|
||||
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
WCHAR src, /* Character code to be converted */
|
||||
WCHAR chr, /* Character code to be converted */
|
||||
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
|
||||
)
|
||||
{
|
||||
@@ -10931,8 +10931,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
int i, n, li, hi;
|
||||
|
||||
|
||||
if (src < 0x80) { /* ASCII */
|
||||
c = src;
|
||||
if (chr < 0x80) { /* ASCII */
|
||||
c = chr;
|
||||
} else {
|
||||
if (dir) { /* OEMCP to unicode */
|
||||
p = oem2uni;
|
||||
@@ -10944,8 +10944,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
li = 0;
|
||||
for (n = 16; n; n--) {
|
||||
i = li + (hi - li) / 2;
|
||||
if (src == p[i * 2]) break;
|
||||
if (src > p[i * 2])
|
||||
if (chr == p[i * 2]) break;
|
||||
if (chr > p[i * 2])
|
||||
li = i;
|
||||
else
|
||||
hi = i;
|
||||
|
||||
@@ -8551,7 +8551,7 @@ const WCHAR oem2uni[] = {
|
||||
|
||||
|
||||
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
WCHAR src, /* Character code to be converted */
|
||||
WCHAR chr, /* Character code to be converted */
|
||||
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
|
||||
)
|
||||
{
|
||||
@@ -8560,8 +8560,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
int i, n, li, hi;
|
||||
|
||||
|
||||
if (src < 0x80) { /* ASCII */
|
||||
c = src;
|
||||
if (chr < 0x80) { /* ASCII */
|
||||
c = chr;
|
||||
} else {
|
||||
if (dir) { /* OEMCP to unicode */
|
||||
p = oem2uni;
|
||||
@@ -8573,8 +8573,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
li = 0;
|
||||
for (n = 16; n; n--) {
|
||||
i = li + (hi - li) / 2;
|
||||
if (src == p[i * 2]) break;
|
||||
if (src > p[i * 2])
|
||||
if (chr == p[i * 2]) break;
|
||||
if (chr > p[i * 2])
|
||||
li = i;
|
||||
else
|
||||
hi = i;
|
||||
|
||||
@@ -6777,7 +6777,7 @@ const WCHAR oem2uni[] = {
|
||||
|
||||
|
||||
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
WCHAR src, /* Character code to be converted */
|
||||
WCHAR chr, /* Character code to be converted */
|
||||
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
|
||||
)
|
||||
{
|
||||
@@ -6786,8 +6786,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
int i, n, li, hi;
|
||||
|
||||
|
||||
if (src < 0x80) { /* ASCII */
|
||||
c = src;
|
||||
if (chr < 0x80) { /* ASCII */
|
||||
c = chr;
|
||||
} else {
|
||||
if (dir) { /* OEMCP to unicode */
|
||||
p = oem2uni;
|
||||
@@ -6799,8 +6799,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
|
||||
li = 0;
|
||||
for (n = 16; n; n--) {
|
||||
i = li + (hi - li) / 2;
|
||||
if (src == p[i * 2]) break;
|
||||
if (src > p[i * 2])
|
||||
if (chr == p[i * 2]) break;
|
||||
if (chr > p[i * 2])
|
||||
li = i;
|
||||
else
|
||||
hi = i;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* Unicode - Local code bidirectional converter (C)ChaN, 2009 */
|
||||
/* Unicode - Local code bidirectional converter (C)ChaN, 2012 */
|
||||
/* (SBCS code pages) */
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* 437 U.S. (OEM)
|
||||
@@ -68,7 +68,7 @@ const WCHAR Tbl[] = { /* CP720(0x80-0xFF) to Unicode conversion table */
|
||||
0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
|
||||
0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0641, 0x00B5, 0x0642,
|
||||
0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A,
|
||||
0x2261, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0xO650, 0x2248,
|
||||
0x2261, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0x0650, 0x2248,
|
||||
0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
|
||||
};
|
||||
|
||||
@@ -499,23 +499,23 @@ const WCHAR Tbl[] = { /* CP1258(0x80-0xFF) to Unicode conversion table */
|
||||
|
||||
|
||||
WCHAR ff_convert ( /* Converted character, Returns zero on error */
|
||||
WCHAR src, /* Character code to be converted */
|
||||
WCHAR chr, /* Character code to be converted */
|
||||
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
|
||||
)
|
||||
{
|
||||
WCHAR c;
|
||||
|
||||
|
||||
if (src < 0x80) { /* ASCII */
|
||||
c = src;
|
||||
if (chr < 0x80) { /* ASCII */
|
||||
c = chr;
|
||||
|
||||
} else {
|
||||
if (dir) { /* OEMCP to Unicode */
|
||||
c = (src >= 0x100) ? 0 : Tbl[src - 0x80];
|
||||
c = (chr >= 0x100) ? 0 : Tbl[chr - 0x80];
|
||||
|
||||
} else { /* Unicode to OEMCP */
|
||||
for (c = 0; c < 0x80; c++) {
|
||||
if (src == Tbl[c]) break;
|
||||
if (chr == Tbl[c]) break;
|
||||
}
|
||||
c = (c + 0x80) & 0xFF;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* Sample code of OS dependent controls for FatFs R0.08b */
|
||||
/* (C)ChaN, 2011 */
|
||||
/* Sample code of OS dependent controls for FatFs */
|
||||
/* (C)ChaN, 2012 */
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
#include <stdlib.h> /* ANSI memory controls */
|
||||
@@ -14,27 +14,31 @@
|
||||
/* Create a Synchronization Object
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* This function is called in f_mount function to create a new
|
||||
/ synchronization object, such as semaphore and mutex. When a zero is
|
||||
/ synchronization object, such as semaphore and mutex. When a FALSE is
|
||||
/ returned, the f_mount function fails with FR_INT_ERR.
|
||||
*/
|
||||
|
||||
int ff_cre_syncobj ( /* TRUE:Function succeeded, FALSE:Could not create due to any error */
|
||||
int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any error */
|
||||
BYTE vol, /* Corresponding logical drive being processed */
|
||||
_SYNC_t *sobj /* Pointer to return the created sync object */
|
||||
)
|
||||
{
|
||||
int ret;
|
||||
// static _SYNC_t sem[_VOLUMES]; /* FreeRTOS */
|
||||
|
||||
*sobj = CreateMutex(NULL, FALSE, NULL); /* Win32 */
|
||||
|
||||
*sobj = CreateMutex(NULL, FALSE, NULL); /* Win32 */
|
||||
ret = (*sobj != INVALID_HANDLE_VALUE);
|
||||
|
||||
// *sobj = SyncObjects[vol]; /* uITRON (give a static sync object) */
|
||||
// ret = 1; /* The initial value of the semaphore must be 1. */
|
||||
// *sobj = SyncObjects[vol]; /* uITRON (give a static created sync object) */
|
||||
// ret = 1; /* The initial value of the semaphore must be 1. */
|
||||
|
||||
// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
|
||||
// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
|
||||
// ret = (err == OS_NO_ERR);
|
||||
|
||||
// *sobj = xSemaphoreCreateMutex(); /* FreeRTOS */
|
||||
// if (!sem[vol]) /* FreeRTOS */
|
||||
// sem[vol] = xSemaphoreCreateMutex();
|
||||
// *sobj = sem[vol];
|
||||
// ret = (*sobj != NULL);
|
||||
|
||||
return ret;
|
||||
@@ -46,15 +50,16 @@ int ff_cre_syncobj ( /* TRUE:Function succeeded, FALSE:Could not create due to a
|
||||
/* Delete a Synchronization Object */
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* This function is called in f_mount function to delete a synchronization
|
||||
/ object that created with ff_cre_syncobj function. When a zero is
|
||||
/ object that created with ff_cre_syncobj function. When a FALSE is
|
||||
/ returned, the f_mount function fails with FR_INT_ERR.
|
||||
*/
|
||||
|
||||
int ff_del_syncobj ( /* TRUE:Function succeeded, FALSE:Could not delete due to any error */
|
||||
int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any error */
|
||||
_SYNC_t sobj /* Sync object tied to the logical drive to be deleted */
|
||||
)
|
||||
{
|
||||
BOOL ret;
|
||||
int ret;
|
||||
|
||||
|
||||
ret = CloseHandle(sobj); /* Win32 */
|
||||
|
||||
@@ -74,7 +79,7 @@ int ff_del_syncobj ( /* TRUE:Function succeeded, FALSE:Could not delete due to a
|
||||
/* Request Grant to Access the Volume */
|
||||
/*------------------------------------------------------------------------*/
|
||||
/* This function is called on entering file functions to lock the volume.
|
||||
/ When a zero is returned, the file function fails with FR_TIMEOUT.
|
||||
/ When a FALSE is returned, the file function fails with FR_TIMEOUT.
|
||||
*/
|
||||
|
||||
int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */
|
||||
@@ -85,9 +90,9 @@ int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get
|
||||
|
||||
ret = (WaitForSingleObject(sobj, _FS_TIMEOUT) == WAIT_OBJECT_0); /* Win32 */
|
||||
|
||||
// ret = (wai_sem(sobj) == E_OK); /* uITRON */
|
||||
// ret = (wai_sem(sobj) == E_OK); /* uITRON */
|
||||
|
||||
// OSMutexPend(sobj, _FS_TIMEOUT, &err)); /* uC/OS-II */
|
||||
// OSMutexPend(sobj, _FS_TIMEOUT, &err)); /* uC/OS-II */
|
||||
// ret = (err == OS_NO_ERR);
|
||||
|
||||
// ret = (xSemaphoreTake(sobj, _FS_TIMEOUT) == pdTRUE); /* FreeRTOS */
|
||||
@@ -114,7 +119,6 @@ void ff_rel_grant (
|
||||
// OSMutexPost(sobj); /* uC/OS-II */
|
||||
|
||||
// xSemaphoreGive(sobj); /* FreeRTOS */
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -130,10 +134,10 @@ void ff_rel_grant (
|
||||
*/
|
||||
|
||||
void* ff_memalloc ( /* Returns pointer to the allocated memory block */
|
||||
UINT size /* Number of bytes to allocate */
|
||||
UINT msize /* Number of bytes to allocate */
|
||||
)
|
||||
{
|
||||
return malloc(size);
|
||||
return malloc(msize);
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +145,7 @@ void* ff_memalloc ( /* Returns pointer to the allocated memory block */
|
||||
/* Free a memory block */
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
void ff_memfree(
|
||||
void ff_memfree (
|
||||
void* mblock /* Pointer to the memory block to free */
|
||||
)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#include "../ff.h"
|
||||
|
||||
#if _USE_LFN != 0
|
||||
|
||||
#if _CODE_PAGE == 932
|
||||
#include "cc932.c"
|
||||
#elif _CODE_PAGE == 936
|
||||
#include "cc936.c"
|
||||
#elif _CODE_PAGE == 949
|
||||
#include "cc949.c"
|
||||
#elif _CODE_PAGE == 950
|
||||
#include "cc950.c"
|
||||
#else
|
||||
#include "ccsbcs.c"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -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
|
||||
|
||||
@@ -241,6 +246,7 @@ GVARS = NO
|
||||
# Define programs and commands.
|
||||
SHELL = sh
|
||||
IMG2LBM = -python ../util/img2lbm.py
|
||||
TRANSLATE = -python ../util/translate.py
|
||||
SVNREV = $(shell sh -c "svnversion | egrep -o '[[:digit:]]+[[:alpha:]]*$$'")
|
||||
|
||||
SRC =
|
||||
@@ -328,7 +334,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 +538,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 +621,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 +639,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 +719,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 +901,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
|
||||
@@ -1011,12 +1030,13 @@ all: begin gccversion sizebefore build sizeafter end
|
||||
|
||||
# Change the build target to build a HEX file or a library.
|
||||
ifeq ($(ARCH), AVR)
|
||||
build: stamp_header lbm allsrc.cpp elf remallsrc hex eep lss sym
|
||||
build: stamp_header tra lbm allsrc.cpp elf remallsrc hex eep lss sym
|
||||
else
|
||||
build: stamp_header lbm allsrc.cpp elf remallsrc bin lss
|
||||
build: stamp_header tra lbm allsrc.cpp elf remallsrc bin lss
|
||||
endif
|
||||
|
||||
lbm: bitmaps/font.lbm bitmaps/sticks.lbm
|
||||
tra: translations/se.h
|
||||
lbm: fonts/std/font_05x07.lbm bitmaps/sticks.lbm
|
||||
|
||||
elf: $(TARGET).elf
|
||||
bin: $(TARGET).bin
|
||||
@@ -1071,30 +1091,67 @@ 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
|
||||
translations/se.h: translations/cz.h.txt translations/de.h.txt translations/es.h.txt translations/fr.h.txt translations/it.h.txt translations/pt.h.txt translations/se.h.txt
|
||||
@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 "Create language specific header files"
|
||||
@echo "Czech"
|
||||
$(TRANSLATE) translations/cz.h.txt translations/cz.h cz
|
||||
@echo "German"
|
||||
$(TRANSLATE) translations/de.h.txt translations/de.h de
|
||||
@echo "Spanish"
|
||||
$(TRANSLATE) translations/es.h.txt translations/es.h es
|
||||
@echo "French"
|
||||
$(TRANSLATE) translations/fr.h.txt translations/fr.h fr
|
||||
@echo "Italian"
|
||||
$(TRANSLATE) translations/it.h.txt translations/it.h it
|
||||
@echo "Portugese"
|
||||
$(TRANSLATE) translations/pt.h.txt translations/pt.h pt
|
||||
@echo "Swedish"
|
||||
$(TRANSLATE) translations/se.h.txt translations/se.h se
|
||||
|
||||
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_cz_04x06.png fonts/std/font_cz_05x07.png fonts/std/font_cz_08x10.png fonts/std/font_cz_10x14.png fonts/std/font_de_04x06.png fonts/std/font_de_05x07.png fonts/std/font_de_08x10.png fonts/std/font_de_10x14.png fonts/std/font_es_04x06.png fonts/std/font_es_05x07.png fonts/std/font_es_08x10.png fonts/std/font_es_10x14.png fonts/std/font_fr_04x06.png fonts/std/font_fr_05x07.png fonts/std/font_fr_08x10.png fonts/std/font_fr_10x14.png fonts/std/font_it_04x06.png fonts/std/font_it_05x07.png fonts/std/font_it_08x10.png fonts/std/font_it_10x14.png fonts/std/font_se_04x06.png fonts/std/font_se_05x07.png fonts/std/font_se_08x10.png fonts/std/font_se_10x14.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.png bitmaps/asterisk_4bits.png
|
||||
@echo
|
||||
@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_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 +1160,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.
|
||||
@@ -1147,7 +1205,7 @@ FOXLIB=-L/usr/local/lib \
|
||||
-lFOX-1.6 \
|
||||
-Wl,-rpath,$(FOXPATH)/src/.libs
|
||||
|
||||
simu: stamp_header $(BOARDSRC) $(CPPSRC) Makefile simu.cpp simpgmspace.cpp *.h lbm eeprom.bin
|
||||
simu: stamp_header $(BOARDSRC) $(CPPSRC) Makefile simu.cpp simpgmspace.cpp *.h tra lbm eeprom.bin
|
||||
g++ $(CPPFLAGS) simu.cpp $(BOARDSRC) $(CPPSRC) simpgmspace.cpp -MD -DSIMU -O0 -o simu $(FOXINC) $(FOXLIB) -pthread
|
||||
|
||||
eeprom.bin:
|
||||
@@ -1215,7 +1273,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.
|
||||
|
||||
@@ -41,53 +41,88 @@
|
||||
|
||||
#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 BEEP_POINTS_COUNT 100
|
||||
|
||||
#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 {
|
||||
int16_t points[BEEP_POINTS_COUNT];
|
||||
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 +130,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 +144,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 +154,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 +249,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 +271,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
|
||||
@@ -240,9 +310,4 @@ extern void refreshSystemAudioFiles();
|
||||
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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
After Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 740 B After Width: | Height: | Size: 740 B |
@@ -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 };
|
||||
@@ -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 };
|
||||
@@ -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 };
|
||||
@@ -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 };
|
||||
@@ -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 };
|
||||
@@ -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 };
|
||||
@@ -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 };
|
||||
@@ -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 };
|
||||
@@ -41,10 +41,10 @@ const pm_char * bmpLoad(uint8_t *dest, const char *filename, const xcoord_t widt
|
||||
FIL bmpFile;
|
||||
UINT read;
|
||||
uint8_t palette[16];
|
||||
uint8_t bmpBuf[64]; /* maximum with 64px */
|
||||
uint8_t bmpBuf[LCD_W]; /* maximum with LCD_W */
|
||||
uint8_t *buf = &bmpBuf[0];
|
||||
|
||||
assert(width <= 64);
|
||||
assert(width <= LCD_W);
|
||||
|
||||
FRESULT result = f_open(&bmpFile, filename, FA_OPEN_EXISTING | FA_READ);
|
||||
if (result != FR_OK) {
|
||||
@@ -179,10 +179,9 @@ const pm_char * bmpLoad(uint8_t *dest, const char *filename, const xcoord_t widt
|
||||
break;
|
||||
|
||||
case 4:
|
||||
n = w/8;
|
||||
for (int32_t i=h-1; i>=0; i--) {
|
||||
result = f_read(&bmpFile, buf, w/2, &read);
|
||||
if (result != FR_OK || read != w/2) {
|
||||
result = f_read(&bmpFile, buf, ((w+7)/8)*4, &read);
|
||||
if (result != FR_OK || read != ((w+7)/8)*4) {
|
||||
f_close(&bmpFile);
|
||||
return SDCARD_ERROR(result);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
*/
|
||||
|
||||
#include "../opentx.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include "fifo.h"
|
||||
|
||||
#if !defined(SIMU)
|
||||
|
||||
|
||||
@@ -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() ;
|
||||
|
||||
@@ -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
|
||||
@@ -1028,10 +1028,6 @@ void eeReadAll()
|
||||
|
||||
void eeCheck(bool immediately)
|
||||
{
|
||||
if (EEPROM_MASSSTORAGE()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (immediately) {
|
||||
eeFlush();
|
||||
}
|
||||
|
||||
|
After Width: | Height: | Size: 154 B |
|
After Width: | Height: | Size: 519 B |
|
After Width: | Height: | Size: 159 B |
|
After Width: | Height: | Size: 570 B |
|
After Width: | Height: | Size: 161 B |
|
After Width: | Height: | Size: 767 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 229 B |
@@ -0,0 +1 @@
|
||||
0x18,0x24,0x16,0x3d,0x00,0x18,0x24,0x25,0x02,0x01,0x18,0x34,0x2c,0x0a,0x01,0x18,0x34,0x2d,0x0a,0x01,0x00,0x24,0x3c,0x22,0x01,0x18,0x24,0x24,0x1a,0x01,0x3c,0x04,0x05,0x0a,0x01,0x28,0x2d,0x36,0x15,0x00,0x1c,0x20,0x22,0x3d,0x00,0x1c,0x21,0x21,0x3c,0x00,0x0c,0x50,0x22,0x1d,0x00,0x38,0x14,0x14,0x3a,0x01,0x00,0x24,0x3e,0x25,0x00,0x3c,0x15,0x16,0x2d,0x00,0x00,0x0c,0x32,0x0d,0x00,0x24,0x35,0x2e,0x25,0x00,0x3e,0x2a,0x2a,0x22,0x01,
|
||||
|
After Width: | Height: | Size: 220 B |
|
After Width: | Height: | Size: 223 B |
@@ -0,0 +1 @@
|
||||
0x00,0x03,0xa0,0x07,0xb0,0x04,0x94,0x04,0x93,0x02,0xf1,0x07,0xe0,0x07,0x00,0x00,0xc0,0x01,0xe1,0x03,0x33,0x06,0x16,0x04,0x13,0x04,0x31,0x06,0x20,0x02,0x00,0x00,0xc0,0x01,0xe0,0x03,0xb0,0x06,0x94,0x04,0xb3,0x04,0xe1,0x06,0xc0,0x02,0x00,0x00,0xc0,0x01,0xe1,0x03,0xb3,0x06,0x96,0x04,0xb3,0x04,0xe1,0x06,0xc0,0x02,0x00,0x00,0x00,0x04,0x10,0x04,0xf4,0x07,0xf3,0x07,0x01,0x04,0x00,0x04,0x00,0x00,0x00,0x00,0xc0,0x01,0xe0,0x03,0x30,0x06,0x14,0x04,0x33,0x06,0xe1,0x03,0xc0,0x01,0x00,0x00,0x11,0x00,0xf3,0x07,0xe6,0x07,0x33,0x00,0x11,0x00,0x30,0x00,0x20,0x00,0x00,0x00,0x60,0x02,0xf1,0x06,0x93,0x04,0x96,0x04,0x93,0x04,0xb1,0x07,0x20,0x03,0x00,0x00,0xf0,0x01,0xf0,0x03,0x00,0x06,0x04,0x04,0x03,0x02,0xf1,0x07,0xf0,0x07,0x00,0x00,0xf0,0x01,0xf0,0x03,0x02,0x06,0x05,0x04,0x05,0x02,0xf2,0x07,0xf0,0x07,0x00,0x00,0xf0,0x04,0xf0,0x0c,0x00,0x09,0x04,0x09,0x83,0x0c,0xf1,0x07,0xf0,0x03,0x00,0x00,0xf0,0x07,0xf8,0x07,0x88,0x00,0x8c,0x00,0x8b,0x00,0x89,0x00,0xf8,0x07,0xf0,0x07,0x00,0x00,0x08,0x04,0x08,0x04,0xfc,0x07,0xfb,0x07,0x09,0x04,0x08,0x04,0x00,0x00,0xf8,0x07,0xf9,0x07,0xcb,0x00,0xce,0x00,0xcb,0x01,0x49,0x03,0x78,0x06,0x30,0x04,0x18,0x00,0x18,0x00,0x30,0x00,0xe4,0x07,0xe3,0x07,0x31,0x00,0x18,0x00,0x18,0x00,0x08,0x06,0x09,0x07,0x8b,0x05,0xce,0x04,0x6b,0x04,0x39,0x04,0x18,0x04,0x00,0x00,0xf8,0x07,0xf8,0x07,0x48,0x04,0x4c,0x04,0x4b,0x04,0x49,0x04,0x08,0x04,0x00,0x00,
|
||||
|
After Width: | Height: | Size: 292 B |
@@ -0,0 +1 @@
|
||||
0x00,0x18,0x00,0x3c,0x60,0x7e,0x60,0x66,0x68,0x66,0x6c,0x66,0x67,0x66,0xe3,0x66,0xc1,0x7f,0x80,0x7f,0x80,0x1f,0xc0,0x3f,0xe0,0x70,0x67,0x60,0x6f,0x60,0x6c,0x60,0x66,0x60,0x63,0x70,0x01,0x38,0x00,0x18,0x80,0x1f,0xc0,0x3f,0xe0,0x76,0x60,0x66,0x68,0x66,0x6c,0x66,0x67,0x66,0xe3,0x66,0xc1,0x07,0x80,0x07,0x80,0x1f,0xc0,0x3f,0xe0,0x76,0x67,0x66,0x6f,0x66,0x6c,0x66,0x66,0x66,0xe3,0x66,0xc1,0x07,0x80,0x07,0x00,0x00,0x00,0x00,0x60,0x60,0x60,0x60,0xe8,0x7f,0xec,0x7f,0x07,0x60,0x03,0x60,0x01,0x00,0x00,0x00,0x80,0x1f,0xc0,0x3f,0xe0,0x70,0x60,0x60,0x68,0x60,0x6c,0x60,0x67,0x60,0xe3,0x70,0xc1,0x3f,0x80,0x1f,0xe0,0x7f,0xe0,0x7f,0x80,0x01,0xc7,0x01,0xef,0x00,0x6c,0x00,0x66,0x00,0xe3,0x00,0xc1,0x01,0x80,0x01,0x80,0x61,0xc0,0x63,0xe0,0x67,0x67,0x66,0x6f,0x66,0x6c,0x66,0x66,0x66,0x63,0x7e,0x01,0x3c,0x00,0x18,0xe0,0x1f,0xe0,0x3f,0x00,0x70,0x00,0x60,0x08,0x60,0x0c,0x70,0x07,0x38,0x03,0x18,0xe1,0x7f,0xe0,0x7f,0xe0,0x1f,0xe0,0x3f,0x00,0x70,0x06,0x60,0x09,0x60,0x09,0x70,0x0f,0x38,0x06,0x18,0xe0,0x7f,0xe0,0x7f,0xe0,0x01,0xe0,0x03,0x00,0x67,0x00,0x66,0x08,0x66,0x0c,0x66,0x07,0x66,0x03,0x76,0xe1,0x3f,0xe0,0x1f,0x80,0x7f,0xc0,0x7f,0xe0,0x06,0x70,0x06,0x38,0x06,0x38,0x06,0x74,0x06,0xe7,0x06,0xc3,0x7f,0x81,0x7f,0x00,0x00,0x00,0x00,0x18,0x60,0x18,0x60,0xfc,0x7f,0xff,0x7f,0x1b,0x60,0x19,0x60,0x00,0x00,0x00,0x00,0xf8,0x7f,0xf8,0x7f,0x18,0x03,0x17,0x03,0x0f,0x07,0x0c,0x0f,0x16,0x1f,0xbb,0x3b,0xf1,0x71,0xe0,0x60,0xf8,0x00,0xf8,0x01,0x80,0x03,0x00,0x07,0x00,0x7e,0x04,0x7e,0x07,0x07,0x83,0x03,0xf9,0x01,0xf8,0x00,0x18,0x70,0x18,0x70,0x18,0x78,0x17,0x7c,0x0f,0x6e,0x0c,0x67,0x96,0x63,0xdb,0x61,0xf9,0x60,0x78,0x60,0xf8,0x7f,0xf8,0x7f,0x18,0x63,0x18,0x63,0x1c,0x63,0x1f,0x63,0x1b,0x63,0x19,0x63,0x18,0x60,0x18,0x60,
|
||||
|
After Width: | Height: | Size: 410 B |
@@ -0,0 +1 @@
|
||||
0x3d,0x0a,0x0a,0x3d,0x00,0x18,0x25,0x14,0x3d,0x00,0x1d,0x22,0x22,0x1d,0x00,0x18,0x25,0x24,0x19,0x00,0x1d,0x20,0x20,0x1d,0x00,0x1a,0x20,0x10,0x3a,0x00,0x7e,0x05,0x25,0x1a,0x00,
|
||||
|
After Width: | Height: | Size: 179 B |
|
After Width: | Height: | Size: 170 B |
@@ -0,0 +1 @@
|
||||
0xe0,0x07,0xf6,0x07,0x96,0x00,0x88,0x00,0x88,0x00,0x96,0x00,0xf6,0x07,0xe0,0x07,0x00,0x03,0xa0,0x07,0xb6,0x04,0x96,0x04,0x90,0x02,0xf6,0x07,0xe6,0x07,0x00,0x00,0xe0,0x01,0xf6,0x03,0x16,0x06,0x08,0x04,0x08,0x04,0x16,0x06,0xf6,0x03,0xe0,0x01,0xc0,0x01,0xe6,0x03,0x36,0x06,0x10,0x04,0x36,0x06,0xe6,0x03,0xc0,0x01,0x00,0x00,0xf8,0x01,0xfb,0x03,0x03,0x06,0x00,0x04,0x03,0x04,0x03,0x06,0xf8,0x03,0xf8,0x01,0xf0,0x01,0xf6,0x03,0x06,0x06,0x00,0x04,0x06,0x02,0xf6,0x07,0xf0,0x07,0x00,0x00,0xf0,0x07,0xf8,0x07,0x8c,0x00,0x86,0x00,0x86,0x00,0x8c,0x00,0xf8,0x07,0xf0,0x07,
|
||||
|
After Width: | Height: | Size: 202 B |
|
After Width: | Height: | Size: 254 B |
@@ -0,0 +1 @@
|
||||
0x3e,0x09,0x12,0x3d,0x00,0x3a,0x11,0x0a,0x39,0x00,
|
||||
|
After Width: | Height: | Size: 144 B |
|
After Width: | Height: | Size: 147 B |
@@ -0,0 +1 @@
|
||||
0xf0,0x07,0xf4,0x07,0x66,0x00,0xc2,0x00,0x86,0x01,0x04,0x07,0xf6,0x07,0xf2,0x07,0xf4,0x07,0xf6,0x07,0x22,0x00,0x16,0x00,0x34,0x00,0xe6,0x07,0xc2,0x07,0x00,0x00,
|
||||
|
After Width: | Height: | Size: 168 B |