- adds a "namespace" for each header - makes clear where a header is expected to come from - better facilitates explicit includesmain
| #ifndef Arduino_h | #ifndef Arduino_h | ||||
| #define Arduino_h | #define Arduino_h | ||||
| #include "WProgram.h" | |||||
| #include "pins_arduino.h" | |||||
| #include "core/WProgram.h" | |||||
| #include "core/pins_arduino.h" | |||||
| #endif | #endif |
| #ifndef client_h | #ifndef client_h | ||||
| #define client_h | #define client_h | ||||
| #include "Print.h" | |||||
| #include "Stream.h" | |||||
| #include "IPAddress.h" | |||||
| #include "core/Print.h" | |||||
| #include "core/Stream.h" | |||||
| #include "core/IPAddress.h" | |||||
| class Client : public Stream { | class Client : public Stream { | ||||
| #ifndef DMAChannel_h_ | #ifndef DMAChannel_h_ | ||||
| #define DMAChannel_h_ | #define DMAChannel_h_ | ||||
| #include "imxrt.h" | |||||
| #include "core/imxrt.h" | |||||
| // Discussion about DMAChannel is here: | // Discussion about DMAChannel is here: | ||||
| // http://forum.pjrc.com/threads/25778-Could-there-be-something-like-an-ISR-template-function/page3 | // http://forum.pjrc.com/threads/25778-Could-there-be-something-like-an-ISR-template-function/page3 |
| #if !defined(EventResponder_h) && defined(__cplusplus) | #if !defined(EventResponder_h) && defined(__cplusplus) | ||||
| #define EventResponder_h | #define EventResponder_h | ||||
| #include <Arduino.h> | |||||
| #include <core/Arduino.h> | |||||
| /* EventResponder lets you control how your program responds to an event. | /* EventResponder lets you control how your program responds to an event. | ||||
| * Imagine a basketball or football (American soccer) player who gets the | * Imagine a basketball or football (American soccer) player who gets the |
| #define FS_H | #define FS_H | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #include <Arduino.h> | |||||
| #include <core/Arduino.h> | |||||
| #define FILE_READ 0 | #define FILE_READ 0 | ||||
| #define FILE_WRITE 1 | #define FILE_WRITE 1 |
| #ifndef HardwareSerial_h | #ifndef HardwareSerial_h | ||||
| #define HardwareSerial_h | #define HardwareSerial_h | ||||
| #include "imxrt.h" | |||||
| #include "core/imxrt.h" | |||||
| // Uncomment to enable 9 bit formats. These are default disabled to save memory. | // Uncomment to enable 9 bit formats. These are default disabled to save memory. | ||||
| //#define SERIAL_9BIT_SUPPORT | //#define SERIAL_9BIT_SUPPORT |
| #ifndef IPAddress_h | #ifndef IPAddress_h | ||||
| #define IPAddress_h | #define IPAddress_h | ||||
| #include <Printable.h> | |||||
| #include <WString.h> | |||||
| #include <core/Printable.h> | |||||
| #include <core/WString.h> | |||||
| // A class to make it easier to handle and pass around IP addresses | // A class to make it easier to handle and pass around IP addresses | ||||
| #define __INTERVALTIMER_H__ | #define __INTERVALTIMER_H__ | ||||
| #include <stddef.h> | #include <stddef.h> | ||||
| #include "imxrt.h" | |||||
| #include "core/imxrt.h" | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { |
| // For compatibility with Arduino's MIDIUSB library | // For compatibility with Arduino's MIDIUSB library | ||||
| #include "usb_midi.h" | |||||
| #include "core/usb_midi.h" | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #if !defined(USB_MIDI) && !defined(USB_MIDI4) && !defined(USB_MIDI16) && !defined(USB_MIDI_SERIAL) && !defined(USB_MIDI4_SERIAL) && !defined(USB_MIDI16_SERIAL) && !defined(USB_MIDI_AUDIO_SERIAL) && !defined(USB_MIDI16_AUDIO_SERIAL) && !defined(USB_EVERYTHING) | #if !defined(USB_MIDI) && !defined(USB_MIDI4) && !defined(USB_MIDI16) && !defined(USB_MIDI_SERIAL) && !defined(USB_MIDI4_SERIAL) && !defined(USB_MIDI16_SERIAL) && !defined(USB_MIDI_AUDIO_SERIAL) && !defined(USB_MIDI16_AUDIO_SERIAL) && !defined(USB_EVERYTHING) |
| #include <inttypes.h> | #include <inttypes.h> | ||||
| #include <stdio.h> // for size_t - gives sprintf and other stuff to all sketches & libs | #include <stdio.h> // for size_t - gives sprintf and other stuff to all sketches & libs | ||||
| #include <stdarg.h> | #include <stdarg.h> | ||||
| #include "core_id.h" | |||||
| #include "WString.h" | |||||
| #include "Printable.h" | |||||
| #include "core/core_id.h" | |||||
| #include "core/WString.h" | |||||
| #include "core/Printable.h" | |||||
| #define DEC 10 | #define DEC 10 | ||||
| #define HEX 16 | #define HEX 16 |
| #ifndef server_h | #ifndef server_h | ||||
| #define server_h | #define server_h | ||||
| #include "Print.h" | |||||
| #include "core/Print.h" | |||||
| class Server : public Print { | class Server : public Print { | ||||
| public: | public: |
| #define Stream_h | #define Stream_h | ||||
| #include <inttypes.h> | #include <inttypes.h> | ||||
| #include "Print.h" | |||||
| #include "core/Print.h" | |||||
| class Stream : public Print | class Stream : public Print | ||||
| { | { |
| #ifndef udp_h | #ifndef udp_h | ||||
| #define udp_h | #define udp_h | ||||
| #include <Stream.h> | |||||
| #include <IPAddress.h> | |||||
| #include <core/Stream.h> | |||||
| #include <core/IPAddress.h> | |||||
| class UDP : public Stream { | class UDP : public Stream { | ||||
| // some libraries and sketches depend on this | // some libraries and sketches depend on this | ||||
| // AVR stuff, assuming Arduino.h or WProgram.h | // AVR stuff, assuming Arduino.h or WProgram.h | ||||
| // automatically includes it... | // automatically includes it... | ||||
| #include <avr/pgmspace.h> | |||||
| #include <avr/interrupt.h> | |||||
| #include <core/avr/pgmspace.h> | |||||
| #include <core/avr/interrupt.h> | |||||
| #include "avr_functions.h" | |||||
| #include "wiring.h" | |||||
| #include "HardwareSerial.h" | |||||
| #include "core/avr_functions.h" | |||||
| #include "core/wiring.h" | |||||
| #include "core/HardwareSerial.h" | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #include "avr_emulation.h" | |||||
| #include "usb_serial.h" | |||||
| #include "usb_seremu.h" | |||||
| #include "usb_keyboard.h" | |||||
| #include "usb_mouse.h" | |||||
| #include "usb_joystick.h" | |||||
| #include "usb_midi.h" | |||||
| #include "usb_rawhid.h" | |||||
| #include "usb_flightsim.h" | |||||
| //#include "usb_mtp.h" | |||||
| #include "usb_audio.h" | |||||
| #include "usb_touch.h" | |||||
| //#include "usb_undef.h" // do not allow usb_desc.h stuff to leak to user programs | |||||
| #include "WCharacter.h" | |||||
| #include "WString.h" | |||||
| #include "elapsedMillis.h" | |||||
| #include "IntervalTimer.h" | |||||
| #include "core/avr_emulation.h" | |||||
| #include "core/usb_serial.h" | |||||
| #include "core/usb_seremu.h" | |||||
| #include "core/usb_keyboard.h" | |||||
| #include "core/usb_mouse.h" | |||||
| #include "core/usb_joystick.h" | |||||
| #include "core/usb_midi.h" | |||||
| #include "core/usb_rawhid.h" | |||||
| #include "core/usb_flightsim.h" | |||||
| //#include "core/usb_mtp.h" | |||||
| #include "core/usb_audio.h" | |||||
| #include "core/usb_touch.h" | |||||
| //#include "core/usb_undef.h" // do not allow usb_desc.h stuff to leak to user programs | |||||
| #include "core/WCharacter.h" | |||||
| #include "core/WString.h" | |||||
| #include "core/elapsedMillis.h" | |||||
| #include "core/IntervalTimer.h" | |||||
| uint16_t makeWord(uint16_t w); | uint16_t makeWord(uint16_t w); | ||||
| uint16_t makeWord(byte h, byte l); | uint16_t makeWord(byte h, byte l); | ||||
| void randomSeed(uint32_t newseed); | void randomSeed(uint32_t newseed); | ||||
| void srandom(unsigned int newseed); | void srandom(unsigned int newseed); | ||||
| #include "pins_arduino.h" | |||||
| #include "core/pins_arduino.h" | |||||
| #endif // __cplusplus | #endif // __cplusplus | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include <ctype.h> | #include <ctype.h> | ||||
| #include "avr_functions.h" | |||||
| #include "core/avr_functions.h" | |||||
| // Not needed here, but some libs assume WString.h or Print.h | // Not needed here, but some libs assume WString.h or Print.h | ||||
| // gives them PROGMEM and other AVR stuff. | // gives them PROGMEM and other AVR stuff. | ||||
| #include "avr/pgmspace.h" | |||||
| #include "core/avr/pgmspace.h" | |||||
| // When compiling programs with this class, the following gcc parameters | // When compiling programs with this class, the following gcc parameters | ||||
| // dramatically increase performance and memory (RAM) efficiency, typically | // dramatically increase performance and memory (RAM) efficiency, typically |
| #include <stddef.h> | #include <stddef.h> | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include "avr_functions.h" | |||||
| #include "core/avr_functions.h" | |||||
| #if defined(ARDUINO_TEENSY40) | #if defined(ARDUINO_TEENSY40) | ||||
| #define E2END 0x437 | #define E2END 0x437 |
| * THE SOFTWARE. | * THE SOFTWARE. | ||||
| */ | */ | ||||
| #include "../avr_emulation.h" | |||||
| #include "core/avr_emulation.h" |
| #ifndef _avr_emulation_h_ | #ifndef _avr_emulation_h_ | ||||
| #define _avr_emulation_h_ | #define _avr_emulation_h_ | ||||
| #include "imxrt.h" | |||||
| #include "core_pins.h" | |||||
| #include "pins_arduino.h" | |||||
| #include "core/imxrt.h" | |||||
| #include "core/core_pins.h" | |||||
| #include "core/pins_arduino.h" | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #endif | #endif | ||||
| #ifdef TEENSYDUINO | #ifdef TEENSYDUINO | ||||
| #include <irq.h> | |||||
| #include <core/irq.h> | |||||
| #endif | #endif | ||||
| /* CMSIS compiler specific defines */ | /* CMSIS compiler specific defines */ |
| @{ | @{ | ||||
| */ | */ | ||||
| #include "cmsis_version.h" | |||||
| #include "core/cmsis_version.h" | |||||
| /* CMSIS CM7 definitions */ | /* CMSIS CM7 definitions */ | ||||
| #define __CM7_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ | #define __CM7_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ |
| */ | */ | ||||
| #pragma once | #pragma once | ||||
| #include "imxrt.h" | |||||
| #include "pins_arduino.h" | |||||
| #include "core/imxrt.h" | |||||
| #include "core/pins_arduino.h" | |||||
| #define HIGH 1 | #define HIGH 1 | ||||
| #define LOW 0 | #define LOW 0 |
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #if ARDUINO >= 100 | #if ARDUINO >= 100 | ||||
| #include "Arduino.h" | |||||
| #include "core/Arduino.h" | |||||
| #else | #else | ||||
| #include "WProgram.h" | |||||
| #include "core/WProgram.h" | |||||
| #endif | #endif | ||||
| class elapsedMillis | class elapsedMillis |
| #pragma once | #pragma once | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include <irq.h> | |||||
| #include <core/irq.h> | |||||
| // Definitions based these documents: | // Definitions based these documents: | ||||
| // i.MX RT1060 Reference Manual, Rev. 2, 12/2019 - https://www.pjrc.com/teensy/datasheets.html | // i.MX RT1060 Reference Manual, Rev. 2, 12/2019 - https://www.pjrc.com/teensy/datasheets.html |
| #define KEYLAYOUTS_H__ | #define KEYLAYOUTS_H__ | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include <avr/pgmspace.h> | |||||
| #include <core/avr/pgmspace.h> | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C"{ | extern "C"{ |
| * -------------------------------------------------------------------- */ | * -------------------------------------------------------------------- */ | ||||
| #include "arm_math.h" | |||||
| #include "core/arm_math.h" | |||||
| #ifndef MATH_HELPER_H | #ifndef MATH_HELPER_H | ||||
| #define MATH_HELPER_H | #define MATH_HELPER_H |
| // For compatibility with some ESP8266 programs | // For compatibility with some ESP8266 programs | ||||
| #include <avr/pgmspace.h> | |||||
| #include <core/avr/pgmspace.h> |
| #ifndef _SMALLOC_I_H | #ifndef _SMALLOC_I_H | ||||
| #define _SMALLOC_I_H | #define _SMALLOC_I_H | ||||
| #include "smalloc.h" | |||||
| #include "core/smalloc.h" | |||||
| #include <string.h> | #include <string.h> | ||||
| #include <limits.h> | #include <limits.h> | ||||
| #include <errno.h> | #include <errno.h> |
| #pragma once | #pragma once | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #ifdef AUDIO_INTERFACE | #ifdef AUDIO_INTERFACE | ||||
| #define FEATURE_MAX_VOLUME 0xFFF // volume accepted from 0 to 0xFFF | #define FEATURE_MAX_VOLUME 0xFFF // volume accepted from 0 to 0xFFF | ||||
| }; | }; | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #include "AudioStream.h" | |||||
| #include "core/AudioStream.h" | |||||
| class AudioInputUSB : public AudioStream | class AudioInputUSB : public AudioStream | ||||
| { | { |
| #pragma once | #pragma once | ||||
| #include "imxrt.h" | |||||
| #include "core/imxrt.h" | |||||
| #if !defined(USB_DISABLED) | #if !defined(USB_DISABLED) | ||||
| #ifndef USBflightsim_h_ | #ifndef USBflightsim_h_ | ||||
| #define USBflightsim_h_ | #define USBflightsim_h_ | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #if defined(FLIGHTSIM_INTERFACE) | #if defined(FLIGHTSIM_INTERFACE) | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #include <inttypes.h> | #include <inttypes.h> | ||||
| #include "elapsedMillis.h" | |||||
| #include "core/elapsedMillis.h" | |||||
| // workaround for elapsedMillis.h bringing in WProgram.h which brings usb_undef.h | // workaround for elapsedMillis.h bringing in WProgram.h which brings usb_undef.h | ||||
| //#undef USB_DESC_LIST_DEFINE | //#undef USB_DESC_LIST_DEFINE | ||||
| //#include "usb_desc.h" | |||||
| //#include "core/usb_desc.h" | |||||
| class FlightSimClass; | class FlightSimClass; | ||||
| class FlightSimCommand; | class FlightSimCommand; |
| #ifndef USBjoystick_h_ | #ifndef USBjoystick_h_ | ||||
| #define USBjoystick_h_ | #define USBjoystick_h_ | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #if defined(JOYSTICK_INTERFACE) | #if defined(JOYSTICK_INTERFACE) | ||||
| #pragma once | #pragma once | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #include "keylayouts.h" | |||||
| #include "core/keylayouts.h" | |||||
| #if defined(KEYBOARD_INTERFACE) | #if defined(KEYBOARD_INTERFACE) | ||||
| // C++ interface | // C++ interface | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #include "Stream.h" | |||||
| #include "core/Stream.h" | |||||
| class usb_keyboard_class : public Print | class usb_keyboard_class : public Print | ||||
| { | { | ||||
| public: | public: |
| #ifndef USBmidi_h_ | #ifndef USBmidi_h_ | ||||
| #define USBmidi_h_ | #define USBmidi_h_ | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #if defined(MIDI_INTERFACE) | #if defined(MIDI_INTERFACE) | ||||
| #ifndef USBmouse_h_ | #ifndef USBmouse_h_ | ||||
| #define USBmouse_h_ | #define USBmouse_h_ | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #if defined(MOUSE_INTERFACE) | #if defined(MOUSE_INTERFACE) | ||||
| #pragma once | #pragma once | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #if defined(MTP_INTERFACE) | #if defined(MTP_INTERFACE) | ||||
| #pragma once | #pragma once | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #if defined(RAWHID_INTERFACE) | #if defined(RAWHID_INTERFACE) | ||||
| #pragma once | #pragma once | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #if defined(SEREMU_INTERFACE) && !defined(CDC_STATUS_INTERFACE) && !defined(CDC_DATA_INTERFACE) | #if defined(SEREMU_INTERFACE) && !defined(CDC_STATUS_INTERFACE) && !defined(CDC_DATA_INTERFACE) | ||||
| // C++ interface | // C++ interface | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #include "Stream.h" | |||||
| #include "core/Stream.h" | |||||
| class usb_seremu_class : public Stream | class usb_seremu_class : public Stream | ||||
| { | { | ||||
| public: | public: | ||||
| #if 0 | #if 0 | ||||
| // Allow Arduino programs using Serial to compile, but Serial will do nothing. | // Allow Arduino programs using Serial to compile, but Serial will do nothing. | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #include "Stream.h" | |||||
| #include "core/Stream.h" | |||||
| class usb_seremu_class : public Stream | class usb_seremu_class : public Stream | ||||
| { | { | ||||
| public: | public: |
| #pragma once | #pragma once | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #if (defined(CDC_STATUS_INTERFACE) && defined(CDC_DATA_INTERFACE)) || defined(USB_DISABLED) | #if (defined(CDC_STATUS_INTERFACE) && defined(CDC_DATA_INTERFACE)) || defined(USB_DISABLED) | ||||
| // C++ interface | // C++ interface | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| #include "Stream.h" | |||||
| #include "core/Stream.h" | |||||
| class usb_serial_class : public Stream | class usb_serial_class : public Stream | ||||
| { | { | ||||
| public: | public: |
| #ifndef USBtouchscreen_h_ | #ifndef USBtouchscreen_h_ | ||||
| #define USBtouchscreen_h_ | #define USBtouchscreen_h_ | ||||
| #include "usb_desc.h" | |||||
| #include "core/usb_desc.h" | |||||
| #if defined(MULTITOUCH_INTERFACE) | #if defined(MULTITOUCH_INTERFACE) | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <stdbool.h> | #include <stdbool.h> | ||||
| #include "binary.h" | |||||
| #include "core_id.h" | |||||
| #include "core_pins.h" | |||||
| #include "core/binary.h" | |||||
| #include "core/core_id.h" | |||||
| #include "core/core_pins.h" | |||||
| // type_traits interferes with min() and other defines | // type_traits interferes with min() and other defines | ||||
| // include it early, so we can define these later | // include it early, so we can define these later |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "AudioStream.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/AudioStream.h" | |||||
| #if defined(__IMXRT1062__) | #if defined(__IMXRT1062__) | ||||
| #define MAX_AUDIO_MEMORY 229376 | #define MAX_AUDIO_MEMORY 229376 |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include "DMAChannel.h" | |||||
| #include "core/DMAChannel.h" | |||||
| // only 16 channels supported, because we don't handle sharing interrupts | // only 16 channels supported, because we don't handle sharing interrupts | ||||
| #define DMA_MAX_CHANNELS 16 | #define DMA_MAX_CHANNELS 16 |
| * https://forum.pjrc.com/threads/44723-Arduino-Events | * https://forum.pjrc.com/threads/44723-Arduino-Events | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "EventResponder.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/EventResponder.h" | |||||
| EventResponder * EventResponder::firstYield = nullptr; | EventResponder * EventResponder::firstYield = nullptr; | ||||
| EventResponder * EventResponder::lastYield = nullptr; | EventResponder * EventResponder::lastYield = nullptr; |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include "HardwareSerial.h" | |||||
| #include "core_pins.h" | |||||
| #include "Arduino.h" | |||||
| //#include "debug/printf.h" | |||||
| #include "core/HardwareSerial.h" | |||||
| #include "core/core_pins.h" | |||||
| #include "core/Arduino.h" | |||||
| //#include "core/debug/printf.h" | |||||
| /*typedef struct { | /*typedef struct { | ||||
| const uint32_t VERID; | const uint32_t VERID; |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "HardwareSerial.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/HardwareSerial.h" | |||||
| #ifndef SERIAL1_TX_BUFFER_SIZE | #ifndef SERIAL1_TX_BUFFER_SIZE | ||||
| #define SERIAL1_TX_BUFFER_SIZE 64 // number of outgoing bytes to buffer | #define SERIAL1_TX_BUFFER_SIZE 64 // number of outgoing bytes to buffer |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "HardwareSerial.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/HardwareSerial.h" | |||||
| #ifndef SERIAL2_TX_BUFFER_SIZE | #ifndef SERIAL2_TX_BUFFER_SIZE | ||||
| #define SERIAL2_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer | #define SERIAL2_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "HardwareSerial.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/HardwareSerial.h" | |||||
| #ifndef SERIAL3_TX_BUFFER_SIZE | #ifndef SERIAL3_TX_BUFFER_SIZE | ||||
| #define SERIAL3_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer | #define SERIAL3_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "HardwareSerial.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/HardwareSerial.h" | |||||
| #ifndef SERIAL4_TX_BUFFER_SIZE | #ifndef SERIAL4_TX_BUFFER_SIZE | ||||
| #define SERIAL4_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer | #define SERIAL4_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "HardwareSerial.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/HardwareSerial.h" | |||||
| #ifndef SERIAL5_TX_BUFFER_SIZE | #ifndef SERIAL5_TX_BUFFER_SIZE | ||||
| #define SERIAL5_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer | #define SERIAL5_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "HardwareSerial.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/HardwareSerial.h" | |||||
| #ifndef SERIAL6_TX_BUFFER_SIZE | #ifndef SERIAL6_TX_BUFFER_SIZE | ||||
| #define SERIAL6_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer | #define SERIAL6_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "HardwareSerial.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/HardwareSerial.h" | |||||
| #ifndef SERIAL7_TX_BUFFER_SIZE | #ifndef SERIAL7_TX_BUFFER_SIZE | ||||
| #define SERIAL7_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer | #define SERIAL7_TX_BUFFER_SIZE 40 // number of outgoing bytes to buffer |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "HardwareSerial.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/HardwareSerial.h" | |||||
| #if defined(__IMXRT1062__) && defined(ARDUINO_TEENSY41) | #if defined(__IMXRT1062__) && defined(ARDUINO_TEENSY41) | ||||
| #ifndef SERIAL8_TX_BUFFER_SIZE | #ifndef SERIAL8_TX_BUFFER_SIZE |
| Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include "IPAddress.h" | |||||
| #include <core/Arduino.h> | |||||
| #include "core/IPAddress.h" | |||||
| size_t IPAddress::printTo(Print& p) const | size_t IPAddress::printTo(Print& p) const | ||||
| { | { |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include "IntervalTimer.h" | |||||
| #include "debug/printf.h" | |||||
| #include "core/IntervalTimer.h" | |||||
| #include "core/debug/printf.h" | |||||
| static void pit_isr(void); | static void pit_isr(void); | ||||
| // developed for Teensyduino have made their way back into | // developed for Teensyduino have made their way back into | ||||
| // Arduino's code base. :-) | // Arduino's code base. :-) | ||||
| #include <Arduino.h> | |||||
| #include <core/Arduino.h> | |||||
| #include "debug/printf.h" | |||||
| #include "core/debug/printf.h" | |||||
| #undef printf | #undef printf | ||||
| size_t Print::write(const uint8_t *buffer, size_t size) | size_t Print::write(const uint8_t *buffer, size_t size) |
| parsing functions based on TextFinder library by Michael Margolis | parsing functions based on TextFinder library by Michael Margolis | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include <core/Arduino.h> | |||||
| #define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait | #define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait | ||||
| #define NO_SKIP_CHAR 1 // a magic char not found in a valid ASCII numeric field | #define NO_SKIP_CHAR 1 // a magic char not found in a valid ASCII numeric field | ||||
| if( target == nullptr) return true; | if( target == nullptr) return true; | ||||
| if( *target == 0) return true; // return true if target is a null string | if( *target == 0) return true; // return true if target is a null string | ||||
| if (terminator == nullptr) termLen = 0; | if (terminator == nullptr) termLen = 0; | ||||
| while( (c = timedRead()) > 0){ | while( (c = timedRead()) > 0){ | ||||
| if( c == target[index]){ | if( c == target[index]){ | ||||
| //////Serial.print("found "); Serial.write(c); Serial.print("index now"); Serial.println(index+1); | //////Serial.print("found "); Serial.write(c); Serial.print("index now"); Serial.println(index+1); |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include <core/Arduino.h> | |||||
| // IntervalTimer based tone. This allows tone() to share the timers with other | // IntervalTimer based tone. This allows tone() to share the timers with other | ||||
| // libraries, rather than permanently hogging one PIT timer even for projects | // libraries, rather than permanently hogging one PIT timer even for projects |
| Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||||
| */ | */ | ||||
| #include <Arduino.h> | |||||
| #include <core/Arduino.h> | |||||
| /*********************************************/ | /*********************************************/ |
| #include "imxrt.h" | |||||
| #include "core_pins.h" | |||||
| #include "debug/printf.h" | |||||
| #include "avr/pgmspace.h" | |||||
| #include "core/imxrt.h" | |||||
| #include "core/core_pins.h" | |||||
| #include "core/debug/printf.h" | |||||
| #include "core/avr/pgmspace.h" | |||||
| static uint8_t calibrating; | static uint8_t calibrating; | ||||
| static uint8_t analog_config_bits = 10; | static uint8_t analog_config_bits = 10; |
| //#include "imxrt.h" | |||||
| //#include "core/imxrt.h" | |||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include "imxrt.h" | |||||
| #include "wiring.h" | |||||
| #include "debug/printf.h" | |||||
| #include "core/imxrt.h" | |||||
| #include "core/wiring.h" | |||||
| #include "core/debug/printf.h" | |||||
| // A brief explanation of F_CPU_ACTUAL vs F_CPU | // A brief explanation of F_CPU_ACTUAL vs F_CPU | ||||
| // https://forum.pjrc.com/threads/57236?p=212642&viewfull=1#post212642 | // https://forum.pjrc.com/threads/57236?p=212642&viewfull=1#post212642 |
| #include "debug/printf.h" | |||||
| #include "core/debug/printf.h" | |||||
| #ifdef PRINT_DEBUG_STUFF | #ifdef PRINT_DEBUG_STUFF | ||||
| #include "avr/pgmspace.h" | |||||
| #include "core/avr/pgmspace.h" | |||||
| #include <stdarg.h> | #include <stdarg.h> | ||||
| #include "imxrt.h" | |||||
| #include "usb_desc.h" | |||||
| #include "core/imxrt.h" | |||||
| #include "core/usb_desc.h" | |||||
| void putchar_debug(char c); | void putchar_debug(char c); | ||||
| static void puint_debug(unsigned int num); | static void puint_debug(unsigned int num); | ||||
| // first is this normal Serial? | // first is this normal Serial? | ||||
| #if defined(PRINT_DEBUG_USING_USB) && defined(CDC_STATUS_INTERFACE) && defined(CDC_DATA_INTERFACE) | #if defined(PRINT_DEBUG_USING_USB) && defined(CDC_STATUS_INTERFACE) && defined(CDC_DATA_INTERFACE) | ||||
| #include "usb_dev.h" | |||||
| #include "usb_serial.h" | |||||
| #include "core/usb_dev.h" | |||||
| #include "core/usb_serial.h" | |||||
| FLASHMEM void putchar_debug(char c) | FLASHMEM void putchar_debug(char c) | ||||
| { | { | ||||
| usb_serial_putchar(c); | usb_serial_putchar(c); | ||||
| FLASHMEM void printf_debug_init(void) {} | FLASHMEM void printf_debug_init(void) {} | ||||
| #elif defined(PRINT_DEBUG_USING_USB) && defined(SEREMU_INTERFACE) && !defined(CDC_STATUS_INTERFACE) && !defined(CDC_DATA_INTERFACE) | #elif defined(PRINT_DEBUG_USING_USB) && defined(SEREMU_INTERFACE) && !defined(CDC_STATUS_INTERFACE) && !defined(CDC_DATA_INTERFACE) | ||||
| #include "usb_dev.h" | |||||
| #include "usb_seremu.h" | |||||
| #include "core/usb_dev.h" | |||||
| #include "core/usb_seremu.h" | |||||
| FLASHMEM void putchar_debug(char c) | FLASHMEM void putchar_debug(char c) | ||||
| { | { | ||||
| usb_seremu_putchar(c); | usb_seremu_putchar(c); |
| #include "core_pins.h" | |||||
| #include "arm_math.h" // micros() synchronization | |||||
| #include "core/core_pins.h" | |||||
| #include "core/arm_math.h" // micros() synchronization | |||||
| //volatile uint32_t F_CPU = 396000000; | //volatile uint32_t F_CPU = 396000000; | ||||
| //volatile uint32_t F_BUS = 132000000; | //volatile uint32_t F_BUS = 132000000; |
| #include "core_pins.h" | |||||
| #include "core/core_pins.h" | |||||
| /* | /* | ||||
| struct digital_pin_bitband_and_config_table_struct { | struct digital_pin_bitband_and_config_table_struct { |
| // Generally you should avoid editing this code, unless you really | // Generally you should avoid editing this code, unless you really | ||||
| // know what you're doing. | // know what you're doing. | ||||
| #include "imxrt.h" | |||||
| #include <avr/eeprom.h> | |||||
| #include "core/imxrt.h" | |||||
| #include <core/avr/eeprom.h> | |||||
| #include <string.h> | #include <string.h> | ||||
| #include "debug/printf.h" | |||||
| #include "core/debug/printf.h" | |||||
| #if defined(ARDUINO_TEENSY40) | #if defined(ARDUINO_TEENSY40) | ||||
| #define FLASH_BASEADDR 0x601F0000 | #define FLASH_BASEADDR 0x601F0000 |
| // but automatically fall back to internal RAM if external RAM can't be used. | // but automatically fall back to internal RAM if external RAM can't be used. | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include "smalloc.h" | |||||
| #include "wiring.h" | |||||
| #include "core/smalloc.h" | |||||
| #include "core/wiring.h" | |||||
| #if defined(ARDUINO_TEENSY41) | #if defined(ARDUINO_TEENSY41) | ||||
| // Teensy 4.1 external RAM address range is 0x70000000 to 0x7FFFFFFF | // Teensy 4.1 external RAM address range is 0x70000000 to 0x7FFFFFFF |
| #include "Arduino.h" | |||||
| #include "pins_arduino.h" | |||||
| #include "debug/printf.h" | |||||
| #include "core/Arduino.h" | |||||
| #include "core/pins_arduino.h" | |||||
| #include "core/debug/printf.h" | |||||
| #define DR_INDEX 0 | #define DR_INDEX 0 | ||||
| #define GDIR_INDEX 1 | #define GDIR_INDEX 1 |
| * SOFTWARE. | * SOFTWARE. | ||||
| */ | */ | ||||
| #include <avr/pgmspace.h> | |||||
| #include <core/avr/pgmspace.h> | |||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include "keylayouts.h" | |||||
| #include "core/keylayouts.h" | |||||
| #ifdef M | #ifdef M | ||||
| #undef M | #undef M |