Skip to content

Commit 0d328e5

Browse files
authored
Merge pull request #6 from facchinm/spifat_fixes
Miscellaneous fixes to tackle #4
2 parents 5a2af3d + 27fb215 commit 0d328e5

File tree

10 files changed

+2824
-2549
lines changed

10 files changed

+2824
-2549
lines changed

cores/arduino/Arduino.h

+5
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ void noInterrupts(void);
107107

108108
int digitalPinToInterrupt(pin_size_t pin);
109109

110+
#define digitalPinToPort(x) (x)
111+
#define digitalPinToBitMask(x) (x)
112+
#define portOutputRegister(x) (x)
113+
#define portInputRegister(x) (x)
114+
110115
#include <variant.h>
111116
#ifdef __cplusplus
112117
#include <SerialUSB.h>

cores/arduino/abi.cpp

-24
This file was deleted.

cores/arduino/new.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
#include "new.h"
88

9+
extern "C" void __cxa_pure_virtual() {}
10+
911
// The C++ spec dictates that allocation failure should cause the
1012
// (non-nothrow version of the) operator new to throw an exception.
1113
// Since we expect to have exceptions disabled, it would be more

cores/arduino/zephyrCommon.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const struct adc_dt_spec arduino_adc[] =
170170
const pin_size_t arduino_analog_pins[] =
171171
{ DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), adc_pin_gpios, ADC_PINS) };
172172

173-
struct adc_channel_cfg channel_cfg[ARRAY_SIZE(arduino_analog_pins)] =
173+
struct adc_channel_cfg channel_cfg[] =
174174
{ DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), io_channels, ADC_CH_CFG) };
175175

176176
size_t analog_pin_index(pin_size_t pinNumber) {
988 Bytes
Binary file not shown.
9.36 KB
Binary file not shown.

libraries/SPI/SPI.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,13 @@ void arduino::ZephyrSPI::usingInterrupt(int interruptNumber) {
7979
void arduino::ZephyrSPI::notUsingInterrupt(int interruptNumber) {
8080
}
8181

82+
#ifndef SPI_MIN_CLOCK_FEQUENCY
83+
#define SPI_MIN_CLOCK_FEQUENCY 1000000
84+
#endif
85+
8286
void arduino::ZephyrSPI::beginTransaction(SPISettings settings) {
8387
memset(&config, 0, sizeof(config));
84-
config.frequency = settings.getClockFreq();
88+
config.frequency = settings.getClockFreq() > SPI_MIN_CLOCK_FEQUENCY ? settings.getClockFreq() : SPI_MIN_CLOCK_FEQUENCY;
8589
auto mode = SPI_MODE_CPOL | SPI_MODE_CPHA;
8690
switch (settings.getDataMode()) {
8791
case SPI_MODE0:

loader/llext_exports.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <stdio.h>
77
#include <stdlib.h>
88
#include <math.h>
9+
#include <zephyr/kernel.h>
910

1011
#define FORCE_EXPORT_SYM(name) \
1112
extern void name(void); \
@@ -35,6 +36,13 @@ EXPORT_SYMBOL(isspace);
3536
EXPORT_SYMBOL(isalnum);
3637
EXPORT_SYMBOL(tolower);
3738
EXPORT_SYMBOL(toupper);
39+
EXPORT_SYMBOL(isalpha);
40+
EXPORT_SYMBOL(iscntrl);
41+
EXPORT_SYMBOL(isdigit);
42+
EXPORT_SYMBOL(isgraph);
43+
EXPORT_SYMBOL(isprint);
44+
EXPORT_SYMBOL(isupper);
45+
EXPORT_SYMBOL(isxdigit);
3846

3947
#if defined(CONFIG_USB_DEVICE_STACK)
4048
EXPORT_SYMBOL(usb_enable);
@@ -96,8 +104,8 @@ FORCE_EXPORT_SYM(inet_pton);
96104
FORCE_EXPORT_SYM(cdc_acm_dte_rate_callback_set);
97105
#endif
98106

99-
FORCE_EXPORT_SYM(k_timer_init);
100-
FORCE_EXPORT_SYM(k_fatal_halt);
107+
EXPORT_SYMBOL(k_timer_init);
108+
EXPORT_SYMBOL(k_fatal_halt);
101109
//FORCE_EXPORT_SYM(k_timer_user_data_set);
102110
//FORCE_EXPORT_SYM(k_timer_start);
103111

variants/arduino_giga_r1_m7/llext-edk/include/zephyr/include/generated/zephyr/autoconf.h

+4
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,17 @@
117117
#define CONFIG_ZEPHYR_CMSIS_MODULE 1
118118
#define CONFIG_HAS_CMSIS_CORE 1
119119
#define CONFIG_HAS_CMSIS_CORE_M 1
120+
#define CONFIG_ZEPHYR_ADI_MODULE 1
120121
#define CONFIG_ZEPHYR_HAL_AMBIQ_MODULE 1
122+
#define CONFIG_ZEPHYR_ATMEL_MODULE 1
121123
#define CONFIG_ZEPHYR_HAL_ESPRESSIF_MODULE 1
122124
#define CONFIG_ZEPHYR_HAL_INFINEON_MODULE 1
123125
#define CONFIG_ZEPHYR_HAL_INTEL_MODULE 1
124126
#define CONFIG_ZEPHYR_HAL_NORDIC_MODULE 1
125127
#define CONFIG_ZEPHYR_HAL_NXP_MODULE 1
126128
#define CONFIG_ZEPHYR_HAL_RENESAS_MODULE 1
129+
#define CONFIG_ZEPHYR_HAL_RPI_PICO_MODULE 1
130+
#define CONFIG_ZEPHYR_HAL_SILABS_MODULE 1
127131
#define CONFIG_ZEPHYR_STM32_MODULE 1
128132
#define CONFIG_ZEPHYR_TI_MODULE 1
129133
#define CONFIG_ZEPHYR_XTENSA_MODULE 1

0 commit comments

Comments
 (0)