Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6d6c164

Browse files
committed
[sync] Fix compilation errors
- All examples are working on Arduino Due
1 parent a56779a commit 6d6c164

File tree

10 files changed

+53
-31
lines changed

10 files changed

+53
-31
lines changed

‎examples/Blink/Blink.ino‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ void setup() {
5757
// this function will be called by "Arduino" thread
5858
void loop() {
5959
// may put some code here that will be run repeatedly
60-
}
60+
}

‎examples/FinSH/FinSH.ino‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
ADD_MSH_CMD(led)
2020
2121
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
22+
led 0 1 2 => Invalid parameter number
23+
led 1 1 => Invalid LED ID
24+
led 0 1 => LED0 turns on
25+
led 0 0 => LED0 turns off
2526
*/
2627

2728
extern "C" {
@@ -54,8 +55,9 @@ extern "C" {
5455
}
5556
return 0;
5657
}
58+
59+
MSH_CMD_EXPORT_ALIAS(led_set, led, Turn on/off builtin LED.);
5760
}
58-
MSH_CMD_EXPORT_ALIAS(led_set, led, Turn on/off builtin LED.);
5961

6062
void setup() {
6163
pinMode(LED_BUILTIN, OUTPUT);

‎src/components/dfs/filesystems/elmfat/ffconf.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,11 @@
263263
/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
264264

265265

266+
#ifdef RT_USING_RTC /* RTT config */
266267
#define FF_FS_NORTC 0
268+
#else
269+
#define FF_FS_NORTC 1
270+
#endif
267271
#define FF_NORTC_MON 1
268272
#define FF_NORTC_MDAY 1
269273
#define FF_NORTC_YEAR 2020

‎src/components/drivers/include/drivers/alarm.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef __ALARM_H__
1414
#define __ALARM_H__
1515

16+
#include "include/rtdef.h"
1617
#include "components/libc/compilers/common/sys/time.h"
17-
#include <rtdef.h>
1818

1919
#define RT_ALARM_TM_NOW -1 /* set the alarm tm_day,tm_mon,tm_sec,etc.
2020
to now.we also call it "don't care" value */

‎src/components/libc/compilers/common/time.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <delay.h>
3030
#endif
3131
#ifdef RT_USING_RTC
32-
#include "include/rtdevice.h"
32+
#include "components/drivers/include/rtdevice.h"
3333
#endif
3434

3535
#define DBG_TAG "time"

‎src/libcpu/arm/cortex-m3/context_gcc.h‎

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
.equ SHPR3, 0xE000ED20 /* system priority register (3) */
2727
.equ PENDSV_PRI_LOWEST, 0xFFFF0000 /* PendSV and SysTick priority value (lowest) */
2828

29+
.equ EXC_RETURN, 0x7FFFFFF
30+
2931
/*
3032
* void rt_hw_context_switch(rt_uint32 from, rt_uint32 to);
31-
* R0 --> from
32-
* R1 --> to
33+
* R0 --> from_thread->sp
34+
* R1 --> to_thread->sp
3335
*/
3436
.global rt_hw_context_switch_interrupt
3537
.type rt_hw_context_switch_interrupt, %function
@@ -57,8 +59,8 @@
5759
STR R1, [R0]
5860
BX LR
5961

60-
/* R0 --> switch from thread stack
61-
* R1 --> switch to thread stack
62+
/* R0 --> from_thread->sp
63+
* R1 --> to_thread->sp
6264
* psr, pc, LR, R12, R3, R2, R1, R0 are pushed into [from] stack
6365
*/
6466
.global pendSVHook
@@ -98,7 +100,24 @@
98100
/* restore interrupt */
99101
MSR PRIMASK, R2
100102

101-
ORR LR, LR, #0x04
103+
LDR R2, =EXC_RETURN
104+
CMP R2, LR, LSR #5
105+
BNE check_stack
106+
ORR LR, LR, #4
107+
BX LR
108+
check_stack:
109+
MOV R0, SP
110+
LDR R1, [R0]
111+
CMP R2, R1, LSR #5
112+
BEQ fix_exc_return
113+
ADD R0, R0, #4
114+
LDR R1, [R0]
115+
CMP R2, R1, LSR #5
116+
BNE _pendsv_exit
117+
fix_exc_return:
118+
ORR R1, R1, #4
119+
STR R1, [R0]
120+
_pendsv_exit:
102121
BX LR
103122

104123
/*
@@ -133,11 +152,11 @@
133152
STR R1, [R0]
134153

135154
/* restore MSP */
136-
LDR r0, =SCB_VTOR
137-
LDR r0, [r0]
138-
LDR r0, [r0]
139-
NOP
140-
MSR msp, r0
155+
// LDR r0, =SCB_VTOR
156+
// LDR r0, [r0]
157+
// LDR r0, [r0]
158+
// NOP
159+
// MSR msp, r0
141160

142161
/* enable interrupts at processor level */
143162
CPSIE F

‎src/rtconfig.h‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// #define CONFIG_USING_TINYSCREEN
1313
// #define CONFIG_USING_SSD1306_SPI4
1414

15+
1516
/* Hardware Config */
1617

1718
/* Longan Nano */
@@ -371,7 +372,6 @@
371372
// #define RT_DEBUG_THREAD (1)
372373

373374

374-
375375
/* RT-Thread Kernel */
376376

377377
#define RT_NAME_MAX (16)
@@ -397,7 +397,7 @@
397397

398398
#define RT_USING_SEMAPHORE /* Required by FINSH, CMSIS-OS */
399399
#define RT_USING_MUTEX /* Required by DFS, DRV, CMSIS-OS */
400-
// #define RT_USING_EVENT /* Required by CMSIS-OS */
400+
// #define RT_USING_EVENT /* Required by alarm, CMSIS-OS */
401401
#define RT_USING_MAILBOX /* Required by GUI */
402402
// #define RT_USING_MESSAGEQUEUE /* Required by CMSIS-OS */
403403
// #define RT_USING_SIGNALS /* Required by ? */
@@ -440,7 +440,6 @@
440440
#endif /* CONFIG_USING_FINSH */
441441

442442

443-
444443
/* Arduino Thread Config */
445444

446445
#ifndef CONFIG_ARDUINO_STACK_SIZE
@@ -454,12 +453,6 @@
454453
#endif
455454

456455

457-
458-
459-
460-
461-
462-
463456
/* RTT Driver COnfig */
464457

465458
#if CONFIG_USING_DRIVER_SERIAL || CONFIG_USING_DRIVER_SPI
@@ -482,8 +475,6 @@
482475
#endif
483476

484477

485-
486-
487478
/* File System Config */
488479

489480
#if (CONFIG_USING_SPISD)

‎src/rtt.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ static rt_err_t arduino_serial_init(void) {
8383

8484
#endif /* defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_ARCH_STM32) */
8585

86-
extern "C" {
87-
/* === Override RT-Thread Functions === */
8886

87+
/* === Override RT-Thread Functions === */
88+
89+
extern "C" {
8990
#if defined(RT_DEBUG)
9091

9192
void assert_failed(uint8_t * file, uint32_t line) {

‎src/rtt.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ extern "C" {
1313
#include "include/rtthread.h"
1414
#include "include/rthw.h"
1515

16+
#ifdef DFS_USING_POSIX
17+
#include "components/dfs/include/dfs_file.h"
18+
#include "components/libc/compilers/common/extension/sys/unistd.h"
19+
#endif /* DFS_USING_POSIX */
20+
1621
#ifdef __cplusplus
1722
}
1823
#endif

‎src/shell_cmd.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ ADD_MSH_CMD(prtscn)
115115
MSH_CMD_EXPORT_ALIAS(led_set, toggle_led, Turn on/off builtin LED.);
116116
ADD_MSH_CMD(led_set)
117117
*/
118-
ADD_MSH_CMD(led_set)
118+
// ADD_MSH_CMD(led_set)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /