Skip to content

Commit e273121

Browse files
committed
update ChaN FatFS t0 0.13+p1
1 parent 92ec13a commit e273121

File tree

11 files changed

+20111
-3924
lines changed

11 files changed

+20111
-3924
lines changed

freeRTOS9xx/include/FreeRTOSBoardDefs.h

+14-14
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ extern "C" {
127127
// System Tick - Scheduler timer
128128
// Prefer to use the Watchdog timer, but also Timer 0, 1, or 3 are ok.
129129

130-
// #define portUSE_WDTO WDTO_15MS // portUSE_WDTO to use the Watchdog Timer for xTaskIncrementTick
130+
// #define portUSE_WDTO WDTO_15MS // portUSE_WDTO to use the Watchdog Timer for xTaskIncrementTick
131131

132132
/* Watchdog period options: WDTO_15MS
133133
WDTO_30MS
@@ -138,13 +138,13 @@ extern "C" {
138138
139139
*/
140140

141-
#define portUSE_TIMER0 // portUSE_TIMER0 to use 8 bit Timer0 for xTaskIncrementTick
142-
// #define portUSE_TIMER1 // portUSE_TIMER1 to use 16 bit Timer1 for xTaskIncrementTick
143-
// #define portUSE_TIMER2 // portUSE_TIMER2 to use 8 bit Timer2 using 32,768Hz for xTaskIncrementTick
144-
// #define portUSE_TIMER3 // portUSE_TIMER3 to use 16 bit Timer3 for xTaskIncrementTick
141+
// #define portUSE_TIMER0 // portUSE_TIMER0 to use 8 bit Timer0 for xTaskIncrementTick
142+
// #define portUSE_TIMER1 // portUSE_TIMER1 to use 16 bit Timer1 for xTaskIncrementTick
143+
#define portUSE_TIMER2 // portUSE_TIMER2 to use 8 bit Timer2 using 32,768Hz for xTaskIncrementTick
144+
// #define portUSE_TIMER3 // portUSE_TIMER3 to use 16 bit Timer3 for xTaskIncrementTick
145145

146146
// Use Timer 2 for a Real Time Clock, if you have a 32kHz watch crystal attached.
147-
// #define portUSE_TIMER2_RTC // portUSE_TIMER2_RTC to use 8 bit RTC Timer2 for system_tick (not xTaskIncrementTick)
147+
// #define portUSE_TIMER2_RTC // portUSE_TIMER2_RTC to use 8 bit RTC Timer2 for system_tick (not xTaskIncrementTick)
148148

149149
#if defined (portUSE_WDTO)
150150
// xxx Watchdog Timer is 128kHz nominal, but 120 kHz at 5V DC and 25 degrees is actually more accurate, from data sheet.
@@ -166,20 +166,20 @@ extern "C" {
166166
* Select WIZCHIP.
167167
* You should select one, \b 5100, \b 5200 ,\b 5500 or etc. \n\n
168168
*/
169-
#define _WIZCHIP_ 5500 // 5100, 5200, 5500
169+
// #define _WIZCHIP_ 5500 // 5100, 5200, 5500
170170

171171
// #define portHD44780_LCD // define the use of the Freetronics HD44780 LCD (or other). Check include hd44780.h for (flexible) pin assignments.
172-
// #define portSD_CARD // define the use of the SD Card for Goldilocks 1284p
173-
// #define portRTC_DEFINED // RTC DS1307 / DS3231 implemented, therefore define.
174-
// #define portANALOGUE // Goldilocks Analogue Capabilities
175-
// #define portANALOGSHIELD // Digilent Analog Shield (only DAC implemented)
172+
#define portSD_CARD // define the use of the SD Card for Goldilocks 1284p
173+
// #define portRTC_DEFINED // RTC DS1307 / DS3231 implemented, therefore define.
174+
// #define portANALOGUE // Goldilocks Analogue Capabilities
175+
// #define portANALOGSHIELD // Digilent Analog Shield (only DAC implemented)
176176

177177
#define portSERIAL_BUFFER_RX 255 // Define the size of the serial receive buffer.
178178
#define portSERIAL_BUFFER_TX 255 // Define the size of the serial transmit buffer, only as long as the longest text.
179-
#define portSERIAL_BUFFER portSERIAL_BUFFER_TX // just for compatibility with older programmes.
179+
#define portSERIAL_BUFFER portSERIAL_BUFFER_TX // just for compatibility with older programmes.
180180

181-
// #define portUSE_TIMER1_PWM // Define which Timer to use as the PWM Timer (not the tick timer).
182-
// though it is better to use Pololu functions, as they support 8x multiplexed servos.
181+
// #define portUSE_TIMER1_PWM // Define which Timer to use as the PWM Timer (not the tick timer).
182+
// though it is better to use Pololu functions, as they support 8x multiplexed servos.
183183

184184
#elif defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega8U2__)
185185
// Arduino Serial I/O MCU Compatible notation.

freeRTOS9xx/include/diskio.h

+17-16
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
#ifndef _DISKIO_DEFINED
66
#define _DISKIO_DEFINED
77

8-
#include <stdint.h>
9-
108
#ifdef __cplusplus
119
extern "C" {
1210
#endif
1311

12+
#include "ffinteger.h"
13+
1414
#define SD_SPI_DIVIDER SPI_CLOCK_DIV2 // xxx single point to control SPI speed when using SD cards
1515

1616
/* Status of Disk Functions */
17-
typedef uint8_t DSTATUS;
17+
typedef BYTE DSTATUS;
1818

1919
/* Results of Disk Functions */
2020
typedef enum {
@@ -23,7 +23,6 @@ typedef enum {
2323
RES_WRPRT, /* 2: Write Protected */
2424
RES_NOTRDY, /* 3: Not Ready */
2525
RES_PARERR, /* 4: Invalid Parameter */
26-
RES_TRIM_ERROR, /* 5: Error executing Sector Erase (Trim)*/
2726
RES_PENDING /* 6: Result pending (Used for ArduSat SPI NetworkFS where diskio.c is on different machine to ff.c) */
2827
} DRESULT;
2928

@@ -42,12 +41,12 @@ typedef enum {
4241
*
4342
*/
4443

45-
/* Generic command (used by FatFs) */
46-
#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
47-
#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
48-
#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
49-
#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
50-
#define CTRL_TRIM 4 /* Force erased a block of sectors (for only _USE_TRIM) */
44+
/* Generic command (Used by FatFs) */
45+
#define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
46+
#define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
47+
#define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
48+
#define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
49+
#define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
5150

5251
/* Generic command (not used by FatFs) */
5352
#define CTRL_POWER 5 /* Get/Set power status */
@@ -61,6 +60,9 @@ typedef enum {
6160
#define MMC_GET_CID 12 /* Get CID */
6261
#define MMC_GET_OCR 13 /* Get OCR */
6362
#define MMC_GET_SDSTAT 14 /* Get SD status */
63+
#define ISDIO_READ 55 /* Read data form SD iSDIO register */
64+
#define ISDIO_WRITE 56 /* Write data to SD iSDIO register */
65+
#define ISDIO_MRITE 57 /* Masked write data to SD iSDIO register */
6466

6567
/* ATA/CF specific ioctl command */
6668
#define ATA_GET_REV 20 /* Get F/W revision */
@@ -84,12 +86,11 @@ typedef enum {
8486
*
8587
*---------------------------------------*/
8688

87-
DSTATUS disk_initialize (uint8_t pdrv);
88-
DSTATUS disk_status (uint8_t pdrv);
89-
DRESULT disk_read (uint8_t pdrv, uint8_t* buff, uint32_t sector, uint8_t count);
90-
DRESULT disk_write (uint8_t pdrv, uint8_t const * buff, uint32_t sector, uint8_t count);
91-
DRESULT disk_ioctl (uint8_t pdrv, uint8_t cmd, void* buff);
92-
89+
DSTATUS disk_initialize (BYTE pdrv);
90+
DSTATUS disk_status (BYTE pdrv);
91+
DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
92+
DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
93+
DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
9394

9495

9596
#ifdef __cplusplus

0 commit comments

Comments
 (0)