Skip to content

Commit 6bc894c

Browse files
authored
Merge branch 'arduino:main' into main
2 parents 304218a + 2ef2b3a commit 6bc894c

File tree

20 files changed

+732
-49
lines changed

20 files changed

+732
-49
lines changed

.github/workflows/compile-examples.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ jobs:
8787
- board:
8888
fqbn: "arduino:renesas_uno:unor4wifi"
8989
additional-sketch-paths: |
90+
- libraries/Arduino_LED_Matrix
9091
- libraries/WiFiS3
9192
- libraries/OTAUpdate
9293
- board:
9394
fqbn: "arduino-git:renesas:unor4wifi"
9495
additional-sketch-paths: |
96+
- libraries/Arduino_LED_Matrix
9597
- libraries/WiFiS3
9698
- libraries/OTAUpdate
9799
- libraries/OPAMP
@@ -157,6 +159,7 @@ jobs:
157159
- name: ArduinoDMX
158160
- name: ArduinoRS485
159161
- name: ArduinoIoTCloud
162+
- name: ArduinoGraphics
160163
platforms: |
161164
# Use Board Manager to install the latest release of Arduino Renesas Boards to get the toolchain
162165
- name: "arduino:renesas_uno"

cores/arduino/IRQManager.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,28 @@ IRQManager& IRQManager::getInstance() {
3838
return instance;
3939
}
4040

41+
bool IRQManager::addGenericInterrupt(GenericIrqCfg_t &cfg, Irq_f fnc /*= nullptr*/){
42+
/* getting the address of the current location of the irq vector table */
43+
volatile uint32_t *irq_ptr = (volatile uint32_t *)SCB->VTOR;
44+
/* set the displacement to the "programmable" part of the table */
45+
irq_ptr += FIXED_IRQ_NUM;
46+
bool rv = false;
47+
48+
if((cfg.irq == FSP_INVALID_VECTOR) && (last_interrupt_index < PROG_IRQ_NUM)) {
49+
if(fnc != nullptr){
50+
R_ICU->IELSR[last_interrupt_index] = cfg.event;
51+
*(irq_ptr + last_interrupt_index) = (uint32_t)fnc;
52+
R_BSP_IrqDisable((IRQn_Type)last_interrupt_index);
53+
R_BSP_IrqStatusClear((IRQn_Type)last_interrupt_index);
54+
NVIC_SetPriority((IRQn_Type)last_interrupt_index, cfg.ipl);
55+
R_BSP_IrqEnable ((IRQn_Type)last_interrupt_index);
56+
cfg.irq = (IRQn_Type)last_interrupt_index;
57+
last_interrupt_index++;
58+
rv = true;
59+
}
60+
}
61+
return rv;
62+
}
4163

4264
bool IRQManager::addADCScanEnd(ADC_Container *adc, Irq_f fnc /*= nullptr*/) {
4365
/* getting the address of the current location of the irq vector table */

cores/arduino/IRQManager.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ typedef struct timer {
125125
agt_extended_cfg_t *agt_ext_cfg;
126126
} TimerIrqCfg_t;
127127

128+
typedef struct genericIrq {
129+
IRQn_Type irq;
130+
uint8_t ipl;
131+
elc_event_t event;
132+
} GenericIrqCfg_t;
128133

129134

130135
#ifdef __cplusplus
@@ -199,7 +204,8 @@ class IRQManager {
199204
it returns true if the interrupt is correctly added */
200205
bool addDMA(dmac_extended_cfg_t &cfg, Irq_f fnc = nullptr);
201206
#endif
202-
207+
208+
bool addGenericInterrupt(GenericIrqCfg_t &cfg, Irq_f fnc = nullptr);
203209
bool addTimerOverflow(TimerIrqCfg_t &cfg, Irq_f fnc = nullptr);
204210
bool addTimerUnderflow(TimerIrqCfg_t &cfg, Irq_f fnc = nullptr);
205211
bool addTimerCompareCaptureA(TimerIrqCfg_t &cfg, Irq_f fnc = nullptr);

libraries/Arduino_CAN/src/CanUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace util
2828
**************************************************************************************/
2929

3030
std::tuple<bool, uint32_t, uint32_t, uint32_t>
31-
calc_can_bit_timing(CanBitRate const can_bitrate,
31+
calc_can_bit_timing(uint32_t const can_bitrate,
3232
uint32_t const can_clock_Hz,
3333
uint32_t const tq_min,
3434
uint32_t const tq_max,

libraries/Arduino_CAN/src/CanUtil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ std::tuple<bool, /* valid result found */
3636
uint32_t, /* baud_rate_prescaler */
3737
uint32_t, /* time_segment_1 */
3838
uint32_t> /* time_segment_2 */
39-
calc_can_bit_timing(CanBitRate const can_bitrate, uint32_t const can_clock_Hz, uint32_t const tq_min, uint32_t const tq_max,
39+
calc_can_bit_timing(uint32_t const can_bitrate, uint32_t const can_clock_Hz, uint32_t const tq_min, uint32_t const tq_max,
4040
uint32_t const tseg1_min, uint32_t const tseg1_max, uint32_t const tseg2_min, uint32_t const tseg2_max);
4141

4242
/**************************************************************************************

libraries/Arduino_CAN/src/R7FA4M1_CAN.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ R7FA4M1_CAN::R7FA4M1_CAN(int const can_tx_pin, int const can_rx_pin)
137137
**************************************************************************************/
138138

139139
bool R7FA4M1_CAN::begin(CanBitRate const can_bitrate)
140+
{
141+
return begin(static_cast<uint32_t>(can_bitrate));
142+
}
143+
144+
bool R7FA4M1_CAN::begin(uint32_t const can_bitrate)
140145
{
141146
bool init_ok = true;
142147

libraries/Arduino_CAN/src/R7FA4M1_CAN.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class R7FA4M1_CAN final : public HardwareCAN
5252

5353

5454
bool begin(CanBitRate const can_bitrate) override;
55+
bool begin(uint32_t const can_bitrate);
5556
void end() override;
5657

5758
void setFilterMask_Standard(uint32_t const mask);

libraries/Arduino_CAN/src/R7FA6M5_CAN.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ R7FA6M5_CAN::R7FA6M5_CAN(int const can_tx_pin, int const can_rx_pin)
100100
**************************************************************************************/
101101

102102
bool R7FA6M5_CAN::begin(CanBitRate const can_bitrate)
103+
{
104+
return begin(static_cast<uint32_t>(can_bitrate));
105+
}
106+
107+
bool R7FA6M5_CAN::begin(uint32_t const can_bitrate)
103108
{
104109
bool init_ok = true;
105110

libraries/Arduino_CAN/src/R7FA6M5_CAN.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class R7FA6M5_CAN final : public HardwareCAN
5454

5555

5656
bool begin(CanBitRate const can_bitrate) override;
57+
bool begin(uint32_t const can_bitrate);
5758
void end() override;
5859

5960

libraries/Arduino_FreeRTOS/src/Arduino_FreeRTOS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2022 by Alexander Entinger <[email protected]>
3-
* CAN library for Arduino.
3+
* FreeRTOS library for Arduino.
44
*
55
* This file is free software; you can redistribute it and/or modify
66
* it under the terms of either the GNU General Public License version 2

0 commit comments

Comments
 (0)