Skip to content

Commit a56779a

Browse files
committed
- FinSH is retired by upstream - Upgrade FatFs from R0.13c to R0.14b - Tested with Arduino DUE
1 parent 2906ad8 commit a56779a

File tree

166 files changed

+13995
-15405
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+13995
-15405
lines changed

examples/FinSH/FinSH.ino

+15-56
Original file line numberDiff line numberDiff line change
@@ -6,66 +6,27 @@
66
#include <rtt.h>
77

88
/* ATTENTION
9-
Please append your new shell commands and variables to "shell_cmd.h" and
10-
"shell_var.h".
9+
- Please enable "CONFIG_USING_FINSH" in "rtconfig.h"
10+
- Please add new shell commands to "shell_cmd.h".
1111
*/
1212

1313
/* NOTES
14-
When using FinSH without MSH (CONFIG_USING_FINSH == 1 &&
15-
CONFIG_USING_MSH == 0):
16-
- please append the following line to "shell_cmd.h":
17-
ADD_FINSH_CMD(led, Turn on/off builtin LED, led, rt_uint32_t, rt_uint32_t id, rt_uint8_t state)
18-
- and append the following 2 lines to "shell_var.h"
19-
ADD_SHELL_VAR(id, LED ID, led_id, finsh_type_uint)
20-
ADD_SHELL_VAR(state, LED state, led_state, finsh_type_uchar)
21-
22-
After uploaded, please send the following command through "Serial Monitor"
23-
and observe the output:
24-
led(0, 1)
25-
led(0, 0)
26-
led(id, state)
27-
state
28-
state=0
29-
led(id, state)
30-
*/
31-
32-
/* NOTES
33-
When using FinSH with MSH (default, CONFIG_USING_FINSH == 1 &&
34-
CONFIG_USING_MSH == 1):
35-
- please append the following line to "shell_cmd.h":
36-
ADD_MSH_CMD(led, Turn on/off builtin LED, led, int, int argc, char **argv)
37-
- due to MSH doesn't support shell variables, "ADD_SHELL_VAR" has no effect
38-
39-
After uploaded, please send the following command through "Serial Monitor"
40-
and observe the output:
41-
led 0, 1, 2
42-
led 1, 1
43-
led 0, 1
14+
- Using "MSH_CMD_EXPORT_ALIAS" macro to export shell command with the following format:
15+
MSH_CMD_EXPORT_ALIAS(function_name, command_name, command description)
16+
- Using "ADD_MSH_CMD" macro to add shell command to system with the following format:
17+
ADD_MSH_CMD(function_name)
18+
- Please insert the following line to "shell_cmd.h":
19+
ADD_MSH_CMD(led)
20+
21+
After uploaded, please send the following command through "Serial Monitor" and observe the output:
22+
led 0 1 2
23+
led 1 1
24+
led 0 1
4425
*/
4526

4627
extern "C" {
4728

48-
#if !CONFIG_USING_MSH
49-
50-
rt_uint32_t led_id = 0;
51-
rt_uint32_t led_state = 1;
52-
53-
rt_uint32_t led(rt_uint32_t id, rt_uint32_t state) {
54-
rt_kprintf("led%d=%d\n", id, state);
55-
if (id != 0) {
56-
return 1;
57-
}
58-
if (state) {
59-
digitalWrite(LED_BUILTIN, HIGH);
60-
} else {
61-
digitalWrite(LED_BUILTIN, LOW);
62-
}
63-
return 0;
64-
}
65-
66-
#else /* !CONFIG_USING_MSH */
67-
68-
int led(int argc, char **argv) {
29+
int led_set(int argc, char **argv) {
6930
// argc - the number of arguments
7031
// argv[0] - command name, e.g. "led"
7132
// argv[n] - nth argument in the type of char array
@@ -93,10 +54,8 @@ extern "C" {
9354
}
9455
return 0;
9556
}
96-
97-
#endif
98-
9957
}
58+
MSH_CMD_EXPORT_ALIAS(led_set, led, Turn on/off builtin LED.);
10059

10160
void setup() {
10261
pinMode(LED_BUILTIN, OUTPUT);

examples/HelloMo/hello_mo.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ int say_hello(unsigned char argc, char **argv) {
1919
}
2020

2121
void module_init(void *param) {
22-
rt_dlmodule_t *self = (rt_dlmodule_t *)param;
22+
struct rt_dlmodule *self = (struct rt_dlmodule *)param;
2323

2424
rt_kprintf("%s init\n", self->parent.name);
2525
}
2626

2727
void module_cleanup(void *param) {
28-
rt_dlmodule_t *self = (rt_dlmodule_t *)param;
28+
struct rt_dlmodule *self = (struct rt_dlmodule *)param;
2929

3030
rt_kprintf("%s cleanup\n", self->parent.name);
3131
}

examples/HelloMo/load_mo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "mo.h"
77

88
int load_hello(unsigned char argc, char **argv) {
9-
rt_dlmodule_t *hello;
9+
struct rt_dlmodule *hello;
1010
int (*say_hello)(unsigned char argc, char **argv);
1111
char *param[2];
1212
(void)argc;

keywords.txt

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ rt_thread_mdelay KEYWORD2
5656
rt_thread_control KEYWORD2
5757
rt_thread_suspend KEYWORD2
5858
rt_thread_resume KEYWORD2
59-
rt_thread_timeout KEYWORD2
6059
rt_thread_sleep KEYWORD2
6160

6261
#######################################

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=RT-Thread
2-
version=0.9.4
2+
version=1.0.0
33
author=onelife <onelife.real@gmail.com>, Bernard Xiong <bernard.xiong@gmail.com>
44
maintainer=onelife <onelife.real@gmail.com>
55
sentence=Real Time Operating System porting for Arduino SAM and SAMD boards

src/components/arduino/drv_iic_ft6206.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ static rt_err_t ft_read_data(struct bsp_ft_contex *ctx) {
150150
(CONFIG_GUI_WIDTH > x) ? CONFIG_GUI_WIDTH - x : 0,
151151
(CONFIG_GUI_HIGH > y) ? CONFIG_GUI_HIGH - y : 0);
152152
}
153+
(void)x;
154+
(void)y;
153155

154156
return RT_EOK;
155157
}

src/components/arduino/drv_rtc.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
/* Includes ------------------------------------------------------------------*/
1010
/* Exported defines ----------------------------------------------------------*/
11-
#define RTC_NAME "RTC"
11+
#define RTC_NAME "rtc"
1212

1313
/* Exported types ------------------------------------------------------------*/
1414
struct bsp_rtc_contex {

src/components/arduino/drv_spiili.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@ static const rt_uint8_t init_code[] = {
119119
static const struct rt_device_graphic_info disp_info = {
120120
.pixel_format = RTGRAPHIC_PIXEL_FORMAT_RGB565,
121121
.bits_per_pixel = 16,
122-
.reserved = 0,
122+
.pitch = 0,
123123
.width = CONFIG_GUI_WIDTH,
124124
.height = CONFIG_GUI_HIGH,
125125
.framebuffer = RT_NULL,
126+
.smem_len = 0,
126127
};
127128

128129
static struct rtgui_graphic_driver_ops disp_ops = {

src/components/arduino/drv_spisd.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -939,13 +939,15 @@ rt_err_t bsp_hw_spiSd_init(void) {
939939
******************************************************************************/
940940
#ifdef RT_USING_FINSH
941941

942-
rt_err_t list_sd(void) {
942+
int list_sd(int argc, char **argv) {
943943
struct bsp_sd_contex *ctx = SD_CTX();
944944
rt_uint8_t buf_res[16];
945945
struct sd_register_cid *cid = (sd_register_cid *)buf_res;
946946
struct rt_device_blk_geometry geometry;
947947
rt_uint32_t temp;
948-
rt_err_t ret;
948+
int ret;
949+
(void)argc;
950+
(void)argv;
949951

950952
if (RT_EOK != (ret = rt_device_open(&ctx->dev, RT_DEVICE_OFLAG_RDWR))) {
951953
rt_kprintf("Error: open failed!\n");
@@ -1008,7 +1010,7 @@ rt_err_t list_sd(void) {
10081010

10091011
return RT_EOK;
10101012
}
1011-
FINSH_FUNCTION_EXPORT(list_sd, show SD information.)
1013+
MSH_CMD_EXPORT(list_sd, Show SD information.)
10121014
#endif /* RT_USING_FINSH */
10131015

10141016
/***************************************************************************//**

src/components/dfs/filesystems/elmfat/00history.txt

+29
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,32 @@ R0.13c (October 14, 2018)
328328
Fixed creating a sub-directory in the fragmented sub-directory on the exFAT volume collapses FAT chain of the parent directory. (appeared at R0.12)
329329
Fixed f_getcwd() cause output buffer overrun when the buffer has a valid drive number. (appeared at R0.13b)
330330

331+
332+
333+
R0.14 (October 14, 2019)
334+
Added support for 64-bit LBA and GUID partition table (FF_LBA64 = 1)
335+
Changed some API functions, f_mkfs() and f_fdisk().
336+
Fixed f_open() function cannot find the file with file name in length of FF_MAX_LFN characters.
337+
Fixed f_readdir() function cannot retrieve long file names in length of FF_MAX_LFN - 1 characters.
338+
Fixed f_readdir() function returns file names with wrong case conversion. (appeared at R0.12)
339+
Fixed f_mkfs() function can fail to create exFAT volume in the second partition. (appeared at R0.12)
340+
341+
342+
R0.14a (December 5, 2020)
343+
Limited number of recursive calls in f_findnext().
344+
Fixed old floppy disks formatted with MS-DOS 2.x and 3.x cannot be mounted.
345+
Fixed some compiler warnings.
346+
347+
348+
349+
R0.14b (April 17, 2021)
350+
Made FatFs uses standard library <string.h> for copy, compare and search instead of built-in string functions.
351+
Added support for long long integer and floating point to f_printf(). (FF_STRF_LLI and FF_STRF_FP)
352+
Made path name parser ignore the terminating separator to allow "dir/".
353+
Improved the compatibility in Unix style path name feature.
354+
Fixed the file gets dead-locked when f_open() failed with some conditions. (appeared at R0.12a)
355+
Fixed f_mkfs() can create wrong exFAT volume due to a timing dependent error. (appeared at R0.12)
356+
Fixed code page 855 cannot be set by f_setcp().
357+
Fixed some compiler warnings.
358+
359+

src/components/dfs/filesystems/elmfat/00readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FatFs Module Source Files R0.13c
1+
FatFs Module Source Files R0.14b
22

33

44
FILES

0 commit comments

Comments
 (0)