Clean up section comments

2.0.x
Scott Lahteine 6 years ago
parent a23021b823
commit 056efaba91

@ -22,50 +22,18 @@
#ifdef __AVR__ #ifdef __AVR__
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "HAL.h" #include "HAL.h"
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
//uint8_t MCUSR; //uint8_t MCUSR;
// -------------------------------------------------------------------------- // ------------------------
// Private Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_init(void) { void HAL_init(void) {
// Init Servo Pins // Init Servo Pins

@ -18,10 +18,6 @@
*/ */
#pragma once #pragma once
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "../shared/HAL_SPI.h" #include "../shared/HAL_SPI.h"
#include "fastio_AVR.h" #include "fastio_AVR.h"
@ -42,9 +38,9 @@
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <avr/io.h> #include <avr/io.h>
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
//#define analogInputToDigitalPin(IO) IO //#define analogInputToDigitalPin(IO) IO
@ -59,9 +55,9 @@
// On AVR this is in math.h? // On AVR this is in math.h?
//#define square(x) ((x)*(x)) //#define square(x) ((x)*(x))
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef uint16_t hal_timer_t; typedef uint16_t hal_timer_t;
#define HAL_TIMER_TYPE_MAX 0xFFFF #define HAL_TIMER_TYPE_MAX 0xFFFF
@ -71,9 +67,9 @@ typedef int8_t pin_t;
#define SHARED_SERVOS HAS_SERVOS #define SHARED_SERVOS HAS_SERVOS
#define HAL_SERVO_LIB Servo #define HAL_SERVO_LIB Servo
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
//extern uint8_t MCUSR; //extern uint8_t MCUSR;
@ -105,9 +101,9 @@ typedef int8_t pin_t;
#endif #endif
#endif #endif
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_init(void); void HAL_init(void);

@ -31,10 +31,6 @@
#ifdef __AVR__ #ifdef __AVR__
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
void spiBegin(void) { void spiBegin(void) {

@ -47,7 +47,7 @@
const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = { const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = {
// PORTLIST // PORTLIST
// ------------------------------------------- // ------------------------
PE , // PE 0 ** 0 ** USART0_RX PE , // PE 0 ** 0 ** USART0_RX
PE , // PE 1 ** 1 ** USART0_TX PE , // PE 1 ** 1 ** USART0_TX
PE , // PE 4 ** 2 ** PWM2 PE , // PE 4 ** 2 ** PWM2
@ -140,7 +140,7 @@ const uint8_t PROGMEM digital_pin_to_port_PGM_plus_70[] = {
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = { const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = {
// PIN IN PORT // PIN IN PORT
// ------------------------------------------- // ------------------------
_BV( 0 ) , // PE 0 ** 0 ** USART0_RX _BV( 0 ) , // PE 0 ** 0 ** USART0_RX
_BV( 1 ) , // PE 1 ** 1 ** USART0_TX _BV( 1 ) , // PE 1 ** 1 ** USART0_TX
_BV( 4 ) , // PE 4 ** 2 ** PWM2 _BV( 4 ) , // PE 4 ** 2 ** PWM2
@ -234,7 +234,7 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM_plus_70[] = {
const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = { const uint8_t PROGMEM digital_pin_to_timer_PGM_plus_70[] = {
// TIMERS // TIMERS
// ------------------------------------------- // ------------------------
NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX NOT_ON_TIMER , // PE 0 ** 0 ** USART0_RX
NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX NOT_ON_TIMER , // PE 1 ** 1 ** USART0_TX
TIMER3B , // PE 4 ** 2 ** PWM2 TIMER3B , // PE 4 ** 2 ** PWM2

@ -25,53 +25,21 @@
#ifdef ARDUINO_ARCH_SAM #ifdef ARDUINO_ARCH_SAM
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "HAL.h" #include "HAL.h"
#include <Wire.h> #include <Wire.h>
#include "usb/usb_task.h" #include "usb/usb_task.h"
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
uint16_t HAL_adc_result; uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Private Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
// HAL initialization task // HAL initialization task
void HAL_init(void) { void HAL_init(void) {
@ -122,9 +90,9 @@ int freeMemory() {
return (int)&free_memory - (heap_end ? heap_end : (int)&_ebss); return (int)&free_memory - (heap_end ? heap_end : (int)&_ebss);
} }
// -------------------------------------------------------------------------- // ------------------------
// ADC // ADC
// -------------------------------------------------------------------------- // ------------------------
void HAL_adc_start_conversion(const uint8_t adc_pin) { void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = analogRead(adc_pin); HAL_adc_result = analogRead(adc_pin);

@ -37,27 +37,18 @@
#ifdef ARDUINO_ARCH_SAM #ifdef ARDUINO_ARCH_SAM
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "../shared/Delay.h" #include "../shared/Delay.h"
// -------------------------------------------------------------------------- // ------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
#if EITHER(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI) #if EITHER(DUE_SOFTWARE_SPI, FORCE_SOFT_SPI)
// -------------------------------------------------------------------------- // ------------------------
// software SPI // Software SPI
// -------------------------------------------------------------------------- // ------------------------
// Make sure GCC optimizes this file. // Make sure GCC optimizes this file.
// Note that this line triggers a bug in GCC which is fixed by casting. // Note that this line triggers a bug in GCC which is fixed by casting.
@ -551,9 +542,9 @@
// slave selects controlled by SPI controller // slave selects controlled by SPI controller
// doesn't support changing SPI speeds for SD card // doesn't support changing SPI speeds for SD card
// -------------------------------------------------------------------------- // ------------------------
// hardware SPI // hardware SPI
// -------------------------------------------------------------------------- // ------------------------
static bool spiInitialized = false; static bool spiInitialized = false;
void spiInit(uint8_t spiRate) { void spiInit(uint8_t spiRate) {

@ -28,36 +28,23 @@
#ifdef ARDUINO_ARCH_SAM #ifdef ARDUINO_ARCH_SAM
// -------------------------------------------------------------------------- // ------------------------
// Includes // Includes
// -------------------------------------------------------------------------- // ------------------------
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "HAL.h" #include "HAL.h"
#include "HAL_timers_Due.h" #include "HAL_timers_Due.h"
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
#define NUM_HARDWARE_TIMERS 9 #define NUM_HARDWARE_TIMERS 9
// -------------------------------------------------------------------------- // ------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private Variables // Private Variables
// -------------------------------------------------------------------------- // ------------------------
const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = { const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
{ TC0, 0, TC0_IRQn, 3}, // 0 - [servo timer5] { TC0, 0, TC0_IRQn, 3}, // 0 - [servo timer5]
@ -71,17 +58,9 @@ const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
{ TC2, 2, TC8_IRQn, 0}, // 8 { TC2, 2, TC8_IRQn, 0}, // 8
}; };
// -------------------------------------------------------------------------- // ------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
/* /*
Timer_clock1: Prescaler 2 -> 42MHz Timer_clock1: Prescaler 2 -> 42MHz

@ -26,15 +26,11 @@
* For ARDUINO_ARCH_SAM * For ARDUINO_ARCH_SAM
*/ */
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline
@ -69,9 +65,9 @@ typedef uint32_t hal_timer_t;
#define HAL_TEMP_TIMER_ISR() void TC4_Handler() #define HAL_TEMP_TIMER_ISR() void TC4_Handler()
#define HAL_TONE_TIMER_ISR() void TC6_Handler() #define HAL_TONE_TIMER_ISR() void TC6_Handler()
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef struct { typedef struct {
Tc *pTimerRegs; Tc *pTimerRegs;
@ -80,15 +76,15 @@ typedef struct {
uint8_t priority; uint8_t priority;
} tTimerConfig; } tTimerConfig;
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
extern const tTimerConfig TimerConfig[]; extern const tTimerConfig TimerConfig[];
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);

@ -22,10 +22,6 @@
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include <rom/rtc.h> #include <rom/rtc.h>
#include <driver/adc.h> #include <driver/adc.h>
@ -48,49 +44,33 @@
#endif #endif
#endif #endif
// -------------------------------------------------------------------------- // ------------------------
// Externals // Externals
// -------------------------------------------------------------------------- // ------------------------
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED; portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
// -------------------------------------------------------------------------- // ------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
#define V_REF 1100 #define V_REF 1100
// -------------------------------------------------------------------------- // ------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
uint16_t HAL_adc_result; uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Private Variables // Private Variables
// -------------------------------------------------------------------------- // ------------------------
esp_adc_cal_characteristics_t characteristics; esp_adc_cal_characteristics_t characteristics;
// -------------------------------------------------------------------------- // ------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_init(void) { void HAL_init(void) {
i2s_init(); i2s_init();
@ -128,9 +108,9 @@ void _delay_ms(int delay_ms) { delay(delay_ms); }
// return free memory between end of heap (or end bss) and whatever is current // return free memory between end of heap (or end bss) and whatever is current
int freeMemory() { return ESP.getFreeHeap(); } int freeMemory() { return ESP.getFreeHeap(); }
// -------------------------------------------------------------------------- // ------------------------
// ADC // ADC
// -------------------------------------------------------------------------- // ------------------------
#define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL #define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL
adc1_channel_t get_channel(int pin) { adc1_channel_t get_channel(int pin) {

@ -24,10 +24,6 @@
#define CPU_32_BIT #define CPU_32_BIT
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
@ -43,9 +39,9 @@
#include "WebSocketSerial.h" #include "WebSocketSerial.h"
#include "FlushableHardwareSerial.h" #include "FlushableHardwareSerial.h"
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
extern portMUX_TYPE spinlock; extern portMUX_TYPE spinlock;
@ -69,24 +65,24 @@ extern portMUX_TYPE spinlock;
#undef pgm_read_ptr #undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr)) #define pgm_read_ptr(addr) (*(addr))
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef int16_t pin_t; typedef int16_t pin_t;
#define HAL_SERVO_LIB Servo #define HAL_SERVO_LIB Servo
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
/** result of last ADC conversion */ /** result of last ADC conversion */
extern uint16_t HAL_adc_result; extern uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
// clear reset reason // clear reset reason
void HAL_clear_reset_source (void); void HAL_clear_reset_source (void);

@ -23,10 +23,6 @@
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include "../shared/HAL_SPI.h" #include "../shared/HAL_SPI.h"
#include <pins_arduino.h> #include <pins_arduino.h>
@ -34,28 +30,28 @@
#include "../../core/macros.h" #include "../../core/macros.h"
#include <SPI.h> #include <SPI.h>
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
static SPISettings spiConfig; static SPISettings spiConfig;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
#if ENABLED(SOFTWARE_SPI) #if ENABLED(SOFTWARE_SPI)
// -------------------------------------------------------------------------- // ------------------------
// Software SPI // Software SPI
// -------------------------------------------------------------------------- // ------------------------
#error "Software SPI not supported for ESP32. Use Hardware SPI." #error "Software SPI not supported for ESP32. Use Hardware SPI."
#else #else
// -------------------------------------------------------------------------- // ------------------------
// Hardware SPI // Hardware SPI
// -------------------------------------------------------------------------- // ------------------------
void spiBegin() { void spiBegin() {
#if !PIN_EXISTS(SS) #if !PIN_EXISTS(SS)

@ -22,10 +22,6 @@
#ifdef ARDUINO_ARCH_ESP32 #ifdef ARDUINO_ARCH_ESP32
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdio.h> #include <stdio.h>
#include "esp_types.h" #include "esp_types.h"
#include "soc/timer_group_struct.h" #include "soc/timer_group_struct.h"
@ -36,28 +32,15 @@
#include "HAL_timers_ESP32.h" #include "HAL_timers_ESP32.h"
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
#define NUM_HARDWARE_TIMERS 4 #define NUM_HARDWARE_TIMERS 4
// -------------------------------------------------------------------------- // ------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private Variables // Private Variables
// -------------------------------------------------------------------------- // ------------------------
static timg_dev_t *TG[2] = {&TIMERG0, &TIMERG1}; static timg_dev_t *TG[2] = {&TIMERG0, &TIMERG1};
@ -68,17 +51,9 @@ const tTimerConfig TimerConfig [NUM_HARDWARE_TIMERS] = {
{ TIMER_GROUP_1, TIMER_1, 1, nullptr }, // 3 { TIMER_GROUP_1, TIMER_1, 1, nullptr }, // 3
}; };
// -------------------------------------------------------------------------- // ------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void IRAM_ATTR timer_group0_isr(void *para) { void IRAM_ATTR timer_group0_isr(void *para) {
const int timer_idx = (int)para; const int timer_idx = (int)para;

@ -21,10 +21,6 @@
*/ */
#pragma once #pragma once
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
#include "driver/timer.h" #include "driver/timer.h"
@ -33,9 +29,9 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include "../../pins/pins.h" #include "../../pins/pins.h"
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
// //
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline
@ -81,9 +77,9 @@ extern "C" void tempTC_Handler(void);
extern "C" void stepTC_Handler(void); extern "C" void stepTC_Handler(void);
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef struct { typedef struct {
timer_group_t group; timer_group_t group;
@ -92,15 +88,15 @@ typedef struct {
void (*fn)(void); void (*fn)(void);
} tTimerConfig; } tTimerConfig;
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
extern const tTimerConfig TimerConfig[]; extern const tTimerConfig TimerConfig[];
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_timer_start (const uint8_t timer_num, uint32_t frequency); void HAL_timer_start (const uint8_t timer_num, uint32_t frequency);
void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t count); void HAL_timer_set_compare(const uint8_t timer_num, const hal_timer_t count);

@ -47,9 +47,9 @@ int freeMemory() {
return 0; return 0;
} }
// -------------------------------------------------------------------------- // ------------------------
// ADC // ADC
// -------------------------------------------------------------------------- // ------------------------
void HAL_adc_init(void) { void HAL_adc_init(void) {

@ -23,10 +23,6 @@
#define CPU_32_BIT #define CPU_32_BIT
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#define F_CPU 100000000 #define F_CPU 100000000
#define SystemCoreClock F_CPU #define SystemCoreClock F_CPU
#include <iostream> #include <iostream>

@ -24,15 +24,11 @@
* HAL timers for Linux X86_64 * HAL timers for Linux X86_64
*/ */
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline

@ -49,15 +49,11 @@
#ifdef TARGET_LPC1768 #ifdef TARGET_LPC1768
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <SPI.h> #include <SPI.h>
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
#if ENABLED(LPC_SOFTWARE_SPI) #if ENABLED(LPC_SOFTWARE_SPI)
#include "SoftwareSPI.h" #include "SoftwareSPI.h"

@ -25,10 +25,6 @@
* HAL For LPC1768 * HAL For LPC1768
*/ */
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
#include "../../core/macros.h" #include "../../core/macros.h"
@ -51,9 +47,9 @@
#define SBIT_MR3R 10 #define SBIT_MR3R 10
#define SBIT_MR3S 11 #define SBIT_MR3S 11
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define _HAL_TIMER(T) _CAT(LPC_TIM, T) #define _HAL_TIMER(T) _CAT(LPC_TIM, T)
#define _HAL_TIMER_IRQ(T) TIMER##T##_IRQn #define _HAL_TIMER_IRQ(T) TIMER##T##_IRQn
@ -95,9 +91,9 @@ typedef uint32_t hal_timer_t;
#define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM) #define STEP_TIMER _HAL_TIMER(STEP_TIMER_NUM)
#define TEMP_TIMER _HAL_TIMER(TEMP_TIMER_NUM) #define TEMP_TIMER _HAL_TIMER(TEMP_TIMER_NUM)
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_timer_init(void); void HAL_timer_init(void);
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);

@ -38,44 +38,15 @@
#endif #endif
#endif #endif
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
uint16_t HAL_adc_result; uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Private Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
// Needed for DELAY_NS() / DELAY_US() on CORTEX-M7 // Needed for DELAY_NS() / DELAY_US() on CORTEX-M7
#if (defined(__arm__) || defined(__thumb__)) && __CORTEX_M == 7 #if (defined(__arm__) || defined(__thumb__)) && __CORTEX_M == 7
@ -129,9 +100,9 @@ extern "C" {
extern unsigned int _ebss; // end of bss section extern unsigned int _ebss; // end of bss section
} }
// -------------------------------------------------------------------------- // ------------------------
// ADC // ADC
// -------------------------------------------------------------------------- // ------------------------
void HAL_adc_start_conversion(const uint8_t adc_pin) { void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = analogRead(adc_pin); HAL_adc_result = analogRead(adc_pin);

@ -24,10 +24,6 @@
#define CPU_32_BIT #define CPU_32_BIT
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../../core/macros.h" #include "../../core/macros.h"
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "../shared/math_32bit.h" #include "../shared/math_32bit.h"
@ -43,9 +39,9 @@
#include <USBSerial.h> #include <USBSerial.h>
#endif #endif
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#if SERIAL_PORT == 0 #if SERIAL_PORT == 0
#error "Serial port 0 does not exist" #error "Serial port 0 does not exist"
@ -128,24 +124,24 @@
#undef pgm_read_ptr #undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr)) #define pgm_read_ptr(addr) (*(addr))
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef int16_t pin_t; typedef int16_t pin_t;
#define HAL_SERVO_LIB libServo #define HAL_SERVO_LIB libServo
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
/** result of last ADC conversion */ /** result of last ADC conversion */
extern uint16_t HAL_adc_result; extern uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
// Memory related // Memory related
#define __bss_end __bss_end__ #define __bss_end __bss_end__

@ -23,35 +23,31 @@
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include <SPI.h> #include <SPI.h>
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
static SPISettings spiConfig; static SPISettings spiConfig;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
#if ENABLED(SOFTWARE_SPI) #if ENABLED(SOFTWARE_SPI)
// -------------------------------------------------------------------------- // ------------------------
// Software SPI // Software SPI
// -------------------------------------------------------------------------- // ------------------------
#error "Software SPI not supported for STM32. Use Hardware SPI." #error "Software SPI not supported for STM32. Use Hardware SPI."
#else #else
// -------------------------------------------------------------------------- // ------------------------
// Hardware SPI // Hardware SPI
// -------------------------------------------------------------------------- // ------------------------
/** /**
* VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz * VGPV SPI speed start and PCLK2/2, by default 108/2 = 54Mhz

@ -22,50 +22,27 @@
#if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC) #if defined(ARDUINO_ARCH_STM32) && !defined(STM32GENERIC)
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include "HAL_timers_STM32.h" #include "HAL_timers_STM32.h"
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
#define NUM_HARDWARE_TIMERS 2 #define NUM_HARDWARE_TIMERS 2
//#define PRESCALER 1 //#define PRESCALER 1
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// -------------------------------------------------------------------------- // ------------------------
// Private Variables // Private Variables
// -------------------------------------------------------------------------- // ------------------------
stm32f4_timer_t TimerHandle[NUM_HARDWARE_TIMERS]; stm32f4_timer_t TimerHandle[NUM_HARDWARE_TIMERS];
// -------------------------------------------------------------------------- // ------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
bool timers_initialized[NUM_HARDWARE_TIMERS] = { false }; bool timers_initialized[NUM_HARDWARE_TIMERS] = { false };

@ -21,16 +21,12 @@
*/ */
#pragma once #pragma once
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline
@ -128,21 +124,21 @@ extern void Temp_Handler(stimer_t *htim);
#define HAL_STEP_TIMER_ISR() void Step_Handler(stimer_t *htim) #define HAL_STEP_TIMER_ISR() void Step_Handler(stimer_t *htim)
#define HAL_TEMP_TIMER_ISR() void Temp_Handler(stimer_t *htim) #define HAL_TEMP_TIMER_ISR() void Temp_Handler(stimer_t *htim)
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef stimer_t stm32f4_timer_t; typedef stimer_t stm32f4_timer_t;
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
extern stm32f4_timer_t TimerHandle[]; extern stm32f4_timer_t TimerHandle[];
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
void HAL_timer_enable_interrupt(const uint8_t timer_num); void HAL_timer_enable_interrupt(const uint8_t timer_num);

@ -27,21 +27,21 @@
* These use GPIO register access for fast port manipulation. * These use GPIO register access for fast port manipulation.
*/ */
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
extern GPIO_TypeDef * FastIOPortMap[]; extern GPIO_TypeDef * FastIOPortMap[];
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void FastIO_init(); // Must be called before using fast io macros void FastIO_init(); // Must be called before using fast io macros
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define _BV32(b) (1UL << (b)) #define _BV32(b) (1UL << (b))

@ -27,22 +27,14 @@
#ifdef __STM32F1__ #ifdef __STM32F1__
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include <STM32ADC.h> #include <STM32ADC.h>
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
#define __I #define __I
#define __IO volatile #define __IO volatile
@ -70,13 +62,10 @@
__IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ __IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
} SCB_Type; } SCB_Type;
// -------------------------------------------------------------------------- // ------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ #define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ #define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
@ -89,18 +78,19 @@
#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */ #define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */
#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ #define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
#ifdef SERIAL_USB #ifdef SERIAL_USB
USBSerial SerialUSB; USBSerial SerialUSB;
#endif #endif
uint16_t HAL_adc_result; uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Private Variables // Private Variables
// -------------------------------------------------------------------------- // ------------------------
STM32ADC adc(ADC1); STM32ADC adc(ADC1);
uint8_t adc_pins[] = { uint8_t adc_pins[] = {
@ -166,13 +156,13 @@ enum TEMP_PINS : char {
uint16_t HAL_adc_results[ADC_PIN_COUNT]; uint16_t HAL_adc_results[ADC_PIN_COUNT];
// -------------------------------------------------------------------------- // ------------------------
// Function prototypes // Function prototypes
// -------------------------------------------------------------------------- // ------------------------
// -------------------------------------------------------------------------- // ------------------------
// Private functions // Private functions
// -------------------------------------------------------------------------- // ------------------------
static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) { static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) {
uint32_t reg_value; uint32_t reg_value;
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */ uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07); /* only values 0..7 are used */
@ -185,9 +175,9 @@ static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) {
SCB->AIRCR = reg_value; SCB->AIRCR = reg_value;
} }
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
// //
// Leave PA11/PA12 intact if USBSerial is not used // Leave PA11/PA12 intact if USBSerial is not used
@ -263,9 +253,9 @@ extern "C" {
} }
*/ */
// -------------------------------------------------------------------------- // ------------------------
// ADC // ADC
// -------------------------------------------------------------------------- // ------------------------
// Init the AD in continuous capture mode // Init the AD in continuous capture mode
void HAL_adc_init(void) { void HAL_adc_init(void) {
// configure the ADC // configure the ADC

@ -32,10 +32,6 @@
#define vsnprintf_P vsnprintf #define vsnprintf_P vsnprintf
#endif #endif
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../../core/macros.h" #include "../../core/macros.h"
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "../shared/math_32bit.h" #include "../shared/math_32bit.h"
@ -51,9 +47,9 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#ifdef SERIAL_USB #ifdef SERIAL_USB
#define UsbSerial Serial #define UsbSerial Serial
@ -156,22 +152,22 @@ void HAL_init(void);
#define RST_SOFTWARE 32 #define RST_SOFTWARE 32
#define RST_BACKUP 64 #define RST_BACKUP 64
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef int8_t pin_t; typedef int8_t pin_t;
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
/** result of last ADC conversion */ /** result of last ADC conversion */
extern uint16_t HAL_adc_result; extern uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
// Disable interrupts // Disable interrupts
#define cli() noInterrupts() #define cli() noInterrupts()

@ -167,9 +167,9 @@ bool SDIO_WriteBlock(uint32_t blockAddress, const uint8_t *data) {
inline uint32_t SDIO_GetCardState(void) { return SDIO_CmdSendStatus(SdCard.RelCardAdd << 16U) ? (SDIO_GetResponse(SDIO_RESP1) >> 9U) & 0x0FU : SDIO_CARD_ERROR; } inline uint32_t SDIO_GetCardState(void) { return SDIO_CmdSendStatus(SdCard.RelCardAdd << 16U) ? (SDIO_GetResponse(SDIO_RESP1) >> 9U) & 0x0FU : SDIO_CARD_ERROR; }
// -------------------------------------------------------------------------- // ------------------------
// SD Commands and Responses // SD Commands and Responses
// -------------------------------------------------------------------------- // ------------------------
void SDIO_SendCommand(uint16_t command, uint32_t argument) { SDIO->ARG = argument; SDIO->CMD = (uint32_t)(SDIO_CMD_CPSMEN | command); } void SDIO_SendCommand(uint16_t command, uint32_t argument) { SDIO->ARG = argument; SDIO->CMD = (uint32_t)(SDIO_CMD_CPSMEN | command); }
uint8_t SDIO_GetCommandResponse(void) { return (uint8_t)(SDIO->RESPCMD); } uint8_t SDIO_GetCommandResponse(void) { return (uint8_t)(SDIO->RESPCMD); }

@ -21,18 +21,14 @@
*/ */
#pragma once #pragma once
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "libmaple/sdio.h" #include "libmaple/sdio.h"
#include "libmaple/dma.h" #include "libmaple/dma.h"
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define SDMMC_CMD_GO_IDLE_STATE ((uint8_t)0) /* Resets the SD memory card. */ #define SDMMC_CMD_GO_IDLE_STATE ((uint8_t)0) /* Resets the SD memory card. */
#define SDMMC_CMD_ALL_SEND_CID ((uint8_t)2) /* Asks any card connected to the host to send the CID numbers on the CMD line. */ #define SDMMC_CMD_ALL_SEND_CID ((uint8_t)2) /* Asks any card connected to the host to send the CID numbers on the CMD line. */
@ -106,9 +102,9 @@
#define SDIO_CLOCK 18000000 /* 18 MHz */ #define SDIO_CLOCK 18000000 /* 18 MHz */
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef struct { typedef struct {
uint32_t CardType; // Card Type uint32_t CardType; // Card Type
@ -121,9 +117,9 @@ typedef struct {
uint32_t LogBlockSize; // Logical block size in bytes uint32_t LogBlockSize; // Logical block size in bytes
} SDIO_CardInfoTypeDef; } SDIO_CardInfoTypeDef;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
inline uint32_t SDIO_GetCardState(void); inline uint32_t SDIO_GetCardState(void);

@ -32,34 +32,25 @@
#ifdef __STM32F1__ #ifdef __STM32F1__
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#include <SPI.h> #include <SPI.h>
// ------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
#if ENABLED(SOFTWARE_SPI) #if ENABLED(SOFTWARE_SPI)
// -------------------------------------------------------------------------- // ------------------------
// Software SPI // Software SPI
// -------------------------------------------------------------------------- // ------------------------
#error "Software SPI not supported for STM32F1. Use hardware SPI." #error "Software SPI not supported for STM32F1. Use hardware SPI."
#else #else
// -------------------------------------------------------------------------- // ------------------------
// Hardware SPI // Hardware SPI
// -------------------------------------------------------------------------- // ------------------------
/** /**
* VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz

@ -26,45 +26,17 @@
#ifdef __STM32F1__ #ifdef __STM32F1__
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include "HAL_timers_STM32F1.h" #include "HAL_timers_STM32F1.h"
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
/** /**
* Timer_clock1: Prescaler 2 -> 36 MHz * Timer_clock1: Prescaler 2 -> 36 MHz

@ -25,16 +25,12 @@
* HAL for stm32duino.com based on Libmaple and compatible (STM32F1) * HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
*/ */
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
#include <libmaple/timer.h> #include <libmaple/timer.h>
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
/** /**
* TODO: Check and confirm what timer we will use for each Temps and stepper driving. * TODO: Check and confirm what timer we will use for each Temps and stepper driving.
@ -96,21 +92,16 @@ timer_dev* get_timer_dev(int number);
extern "C" void tempTC_Handler(void); extern "C" void tempTC_Handler(void);
extern "C" void stepTC_Handler(void); extern "C" void stepTC_Handler(void);
// -------------------------------------------------------------------------- // ------------------------
// Types // Public Variables
// -------------------------------------------------------------------------- // ------------------------
//static HardwareTimer StepperTimer(STEP_TIMER_NUM);
//static HardwareTimer TempTimer(TEMP_TIMER_NUM);
// -------------------------------------------------------------------------- // ------------------------
// Public Variables
// --------------------------------------------------------------------------
/*
static HardwareTimer StepperTimer(STEP_TIMER_NUM);
static HardwareTimer TempTimer(TEMP_TIMER_NUM);
*/
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
void HAL_timer_enable_interrupt(const uint8_t timer_num); void HAL_timer_enable_interrupt(const uint8_t timer_num);

@ -45,9 +45,9 @@
******************************************************************************/ ******************************************************************************/
#pragma once #pragma once
// -------------------------------------------------------------------------- // ------------------------
// Includes // Includes
// -------------------------------------------------------------------------- // ------------------------
#include "../../../inc/MarlinConfig.h" #include "../../../inc/MarlinConfig.h"
#include "../HAL.h" #include "../HAL.h"

@ -28,58 +28,30 @@
#if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM) #if ENABLED(EEPROM_SETTINGS) && NONE(I2C_EEPROM, SPI_EEPROM)
// -------------------------------------------------------------------------- // ------------------------
// Includes // Includes
// -------------------------------------------------------------------------- // ------------------------
#include "HAL.h" #include "HAL.h"
#include "EEPROM_Emul/eeprom_emul.h" #include "EEPROM_Emul/eeprom_emul.h"
// ------------------------
// --------------------------------------------------------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private Variables
// --------------------------------------------------------------------------
static bool eeprom_initialized = false;
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions
// --------------------------------------------------------------------------
// FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to // FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to
// FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F4 // FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F4
// #define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR // #define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR
// -------------------------------------------------------------------------- // ------------------------
// EEPROM // Private Variables
// -------------------------------------------------------------------------- // ------------------------
static bool eeprom_initialized = false;
// ------------------------
// Public functions
// ------------------------
void eeprom_init() { void eeprom_init() {
if (!eeprom_initialized) { if (!eeprom_initialized) {

@ -23,51 +23,19 @@
#if defined(STM32GENERIC) && defined(STM32F4) #if defined(STM32GENERIC) && defined(STM32F4)
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
//#include <Wire.h> //#include <Wire.h>
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
uint16_t HAL_adc_result; uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Private Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
/* VGPV Done with defines /* VGPV Done with defines
// disable interrupts // disable interrupts
@ -118,9 +86,9 @@ extern "C" {
} }
*/ */
// -------------------------------------------------------------------------- // ------------------------
// ADC // ADC
// -------------------------------------------------------------------------- // ------------------------
void HAL_adc_start_conversion(const uint8_t adc_pin) { void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = analogRead(adc_pin); HAL_adc_result = analogRead(adc_pin);

@ -28,10 +28,6 @@
#define vsnprintf_P vsnprintf #define vsnprintf_P vsnprintf
#endif #endif
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "../shared/math_32bit.h" #include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h" #include "../shared/HAL_SPI.h"
@ -47,9 +43,9 @@
#include <USBSerial.h> #include <USBSerial.h>
#endif #endif
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
//Serial override //Serial override
//extern HalSerial usb_serial; //extern HalSerial usb_serial;
@ -136,24 +132,24 @@
#undef pgm_read_ptr #undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr)) #define pgm_read_ptr(addr) (*(addr))
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef int8_t pin_t; typedef int8_t pin_t;
#define HAL_SERVO_LIB libServo #define HAL_SERVO_LIB libServo
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
/** result of last ADC conversion */ /** result of last ADC conversion */
extern uint16_t HAL_adc_result; extern uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
// Memory related // Memory related
#define __bss_end __bss_end__ #define __bss_end __bss_end__

@ -32,10 +32,6 @@
#if defined(STM32GENERIC) && defined(STM32F4) #if defined(STM32GENERIC) && defined(STM32F4)
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include "../shared/HAL_SPI.h" #include "../shared/HAL_SPI.h"
#include <pins_arduino.h> #include <pins_arduino.h>
@ -43,28 +39,28 @@
#include "../../core/macros.h" #include "../../core/macros.h"
#include <SPI.h> #include <SPI.h>
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
static SPISettings spiConfig; static SPISettings spiConfig;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
#if ENABLED(SOFTWARE_SPI) #if ENABLED(SOFTWARE_SPI)
// -------------------------------------------------------------------------- // ------------------------
// Software SPI // Software SPI
// -------------------------------------------------------------------------- // ------------------------
#error "Software SPI not supported for STM32F4. Use hardware SPI." #error "Software SPI not supported for STM32F4. Use hardware SPI."
#else #else
// -------------------------------------------------------------------------- // ------------------------
// Hardware SPI // Hardware SPI
// -------------------------------------------------------------------------- // ------------------------
/** /**
* VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz

@ -22,52 +22,28 @@
#if defined(STM32GENERIC) && defined(STM32F4) #if defined(STM32GENERIC) && defined(STM32F4)
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include "HAL_timers_STM32F4.h" #include "HAL_timers_STM32F4.h"
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
#define NUM_HARDWARE_TIMERS 2 #define NUM_HARDWARE_TIMERS 2
#define STEP_TIMER_IRQ_ID TIM5_IRQn #define STEP_TIMER_IRQ_ID TIM5_IRQn
#define TEMP_TIMER_IRQ_ID TIM7_IRQn #define TEMP_TIMER_IRQ_ID TIM7_IRQn
//#define PRESCALER 1 //#define PRESCALER 1
// -------------------------------------------------------------------------- // ------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private Variables // Private Variables
// -------------------------------------------------------------------------- // ------------------------
stm32f4_timer_t TimerHandle[NUM_HARDWARE_TIMERS]; stm32f4_timer_t TimerHandle[NUM_HARDWARE_TIMERS];
// -------------------------------------------------------------------------- // ------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
bool timers_initialized[NUM_HARDWARE_TIMERS] = {false}; bool timers_initialized[NUM_HARDWARE_TIMERS] = {false};

@ -21,15 +21,11 @@
*/ */
#pragma once #pragma once
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline
@ -75,9 +71,9 @@
#endif #endif
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
#ifdef STM32GENERIC #ifdef STM32GENERIC
typedef struct { typedef struct {
@ -89,15 +85,15 @@
typedef stimer_t stm32f4_timer_t; typedef stimer_t stm32f4_timer_t;
#endif #endif
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
extern stm32f4_timer_t TimerHandle[]; extern stm32f4_timer_t TimerHandle[];
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
void HAL_timer_enable_interrupt(const uint8_t timer_num); void HAL_timer_enable_interrupt(const uint8_t timer_num);

@ -45,9 +45,9 @@
*****************************************************************************/ *****************************************************************************/
#pragma once #pragma once
// -------------------------------------------------------------------------- // ------------------------
// Includes // Includes
// -------------------------------------------------------------------------- // ------------------------
#include "../../../inc/MarlinConfig.h" #include "../../../inc/MarlinConfig.h"
#include "../HAL.h" #include "../HAL.h"

@ -26,58 +26,30 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
// -------------------------------------------------------------------------- // ------------------------
// Includes // Includes
// -------------------------------------------------------------------------- // ------------------------
#include "HAL.h" #include "HAL.h"
#include "EEPROM_Emul/eeprom_emul.h" #include "EEPROM_Emul/eeprom_emul.h"
// ------------------------
// --------------------------------------------------------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private Variables
// --------------------------------------------------------------------------
static bool eeprom_initialized = false;
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions
// --------------------------------------------------------------------------
// FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to // FLASH_FLAG_PGSERR (Programming Sequence Error) was renamed to
// FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F7 // FLASH_FLAG_ERSERR (Erasing Sequence Error) in STM32F7
#define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR #define FLASH_FLAG_PGSERR FLASH_FLAG_ERSERR
// -------------------------------------------------------------------------- // ------------------------
// EEPROM // Private Variables
// -------------------------------------------------------------------------- // ------------------------
static bool eeprom_initialized = false;
// ------------------------
// Public functions
// ------------------------
void eeprom_init() { void eeprom_init() {
if (!eeprom_initialized) { if (!eeprom_initialized) {

@ -23,51 +23,19 @@
#ifdef STM32F7 #ifdef STM32F7
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
//#include <Wire.h> //#include <Wire.h>
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
uint16_t HAL_adc_result; uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Private Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
/* VGPV Done with defines /* VGPV Done with defines
// disable interrupts // disable interrupts
@ -124,9 +92,9 @@ extern "C" {
} }
*/ */
// -------------------------------------------------------------------------- // ------------------------
// ADC // ADC
// -------------------------------------------------------------------------- // ------------------------
void HAL_adc_start_conversion(const uint8_t adc_pin) { void HAL_adc_start_conversion(const uint8_t adc_pin) {
HAL_adc_result = analogRead(adc_pin); HAL_adc_result = analogRead(adc_pin);

@ -28,10 +28,6 @@
#define vsnprintf_P vsnprintf #define vsnprintf_P vsnprintf
#endif #endif
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
@ -45,9 +41,9 @@
#include "../../inc/MarlinConfigPre.h" #include "../../inc/MarlinConfigPre.h"
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
//Serial override //Serial override
//extern HalSerial usb_serial; //extern HalSerial usb_serial;
@ -125,22 +121,22 @@
#undef pgm_read_ptr #undef pgm_read_ptr
#define pgm_read_ptr(addr) (*(addr)) #define pgm_read_ptr(addr) (*(addr))
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef int8_t pin_t; typedef int8_t pin_t;
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
/** result of last ADC conversion */ /** result of last ADC conversion */
extern uint16_t HAL_adc_result; extern uint16_t HAL_adc_result;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
// Memory related // Memory related
#define __bss_end __bss_end__ #define __bss_end __bss_end__

@ -32,10 +32,6 @@
#ifdef STM32F7 #ifdef STM32F7
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include "../shared/HAL_SPI.h" #include "../shared/HAL_SPI.h"
#include <pins_arduino.h> #include <pins_arduino.h>
@ -43,27 +39,27 @@
#include "../../core/macros.h" #include "../../core/macros.h"
#include <SPI.h> #include <SPI.h>
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
static SPISettings spiConfig; static SPISettings spiConfig;
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
#if ENABLED(SOFTWARE_SPI) #if ENABLED(SOFTWARE_SPI)
// -------------------------------------------------------------------------- // ------------------------
// Software SPI // Software SPI
// -------------------------------------------------------------------------- // ------------------------
#error "Software SPI not supported for STM32F7. Use hardware SPI." #error "Software SPI not supported for STM32F7. Use hardware SPI."
#else #else
// -------------------------------------------------------------------------- // ------------------------
// Hardware SPI // Hardware SPI
// -------------------------------------------------------------------------- // ------------------------
/** /**
* VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz * VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz

@ -22,51 +22,26 @@
#ifdef STM32F7 #ifdef STM32F7
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "HAL.h" #include "HAL.h"
#include "HAL_timers_STM32F7.h" #include "HAL_timers_STM32F7.h"
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines // Local defines
// -------------------------------------------------------------------------- // ------------------------
#define NUM_HARDWARE_TIMERS 2 #define NUM_HARDWARE_TIMERS 2
//#define PRESCALER 1 //#define PRESCALER 1
// -------------------------------------------------------------------------- // ------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private Variables // Private Variables
// -------------------------------------------------------------------------- // ------------------------
tTimerConfig timerConfig[NUM_HARDWARE_TIMERS]; tTimerConfig timerConfig[NUM_HARDWARE_TIMERS];
// -------------------------------------------------------------------------- // ------------------------
// Function prototypes
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private functions
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
bool timers_initialized[NUM_HARDWARE_TIMERS] = {false}; bool timers_initialized[NUM_HARDWARE_TIMERS] = {false};

@ -21,15 +21,11 @@
*/ */
#pragma once #pragma once
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline
@ -69,9 +65,9 @@ extern void TC7_Handler();
#define HAL_STEP_TIMER_ISR() void TC5_Handler() #define HAL_STEP_TIMER_ISR() void TC5_Handler()
#define HAL_TEMP_TIMER_ISR() void TC7_Handler() #define HAL_TEMP_TIMER_ISR() void TC7_Handler()
// -------------------------------------------------------------------------- // ------------------------
// Types // Types
// -------------------------------------------------------------------------- // ------------------------
typedef struct { typedef struct {
TIM_HandleTypeDef timerdef; TIM_HandleTypeDef timerdef;
@ -79,15 +75,15 @@ typedef struct {
uint32_t callback; uint32_t callback;
} tTimerConfig; } tTimerConfig;
// -------------------------------------------------------------------------- // ------------------------
// Public Variables // Public Variables
// -------------------------------------------------------------------------- // ------------------------
//extern const tTimerConfig timerConfig[]; //extern const tTimerConfig timerConfig[];
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency); void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
void HAL_timer_enable_interrupt(const uint8_t timer_num); void HAL_timer_enable_interrupt(const uint8_t timer_num);

@ -28,15 +28,11 @@
#pragma once #pragma once
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline

@ -27,10 +27,6 @@
#define CPU_32_BIT #define CPU_32_BIT
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../shared/Marduino.h" #include "../shared/Marduino.h"
#include "../shared/math_32bit.h" #include "../shared/math_32bit.h"
#include "../shared/HAL_SPI.h" #include "../shared/HAL_SPI.h"
@ -47,9 +43,9 @@
#define ST7920_DELAY_2 DELAY_NS(750) #define ST7920_DELAY_2 DELAY_NS(750)
#define ST7920_DELAY_3 DELAY_NS(750) #define ST7920_DELAY_3 DELAY_NS(750)
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define IS_32BIT_TEENSY (defined(__MK64FX512__) || defined(__MK66FX1M0__)) #define IS_32BIT_TEENSY (defined(__MK64FX512__) || defined(__MK66FX1M0__))
#define IS_TEENSY35 defined(__MK64FX512__) #define IS_TEENSY35 defined(__MK64FX512__)

@ -25,15 +25,11 @@
* Teensy3.6 (__MK66FX1M0__) * Teensy3.6 (__MK66FX1M0__)
*/ */
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include <stdint.h> #include <stdint.h>
// -------------------------------------------------------------------------- // ------------------------
// Defines // Defines
// -------------------------------------------------------------------------- // ------------------------
#define FORCE_INLINE __attribute__((always_inline)) inline #define FORCE_INLINE __attribute__((always_inline)) inline

@ -29,50 +29,18 @@
#if ENABLED(I2C_EEPROM) #if ENABLED(I2C_EEPROM)
// --------------------------------------------------------------------------
// Includes
// --------------------------------------------------------------------------
#include "../HAL.h" #include "../HAL.h"
#include <Wire.h> #include <Wire.h>
// -------------------------------------------------------------------------- // ------------------------
// Externals
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Local defines
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Types
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Public Variables
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
// Private Variables // Private Variables
// -------------------------------------------------------------------------- // ------------------------
// --------------------------------------------------------------------------
// Function prototypes
// --------------------------------------------------------------------------
// -------------------------------------------------------------------------- static uint8_t eeprom_device_address = 0x50;
// Private functions
// --------------------------------------------------------------------------
// -------------------------------------------------------------------------- // ------------------------
// Public functions // Public functions
// -------------------------------------------------------------------------- // ------------------------
static uint8_t eeprom_device_address = 0x50;
static void eeprom_init(void) { static void eeprom_init(void) {
static bool eeprom_initialized = false; static bool eeprom_initialized = false;

@ -108,7 +108,7 @@ const PinName digitalPin[] = {
PE_15, //D64 - 1:FSMC_D12 PE_15, //D64 - 1:FSMC_D12
PD_8, //D65 - 1:FSMC_D13 / USART3_TX PD_8, //D65 - 1:FSMC_D13 / USART3_TX
PD_9, //D66 - 1:FSMC_D14 / USART3_RX PD_9, //D66 - 1:FSMC_D14 / USART3_RX
PD_10, //D67 - 1:FSMC_D15 PD_10, //D67 - 1:FSMC_D15
PD_11, //D68 - 1:FSMC_A16 PD_11, //D68 - 1:FSMC_A16
PD_12, //D69 - 1:FSMC_A17 / TIM4_CH1 PD_12, //D69 - 1:FSMC_A17 / TIM4_CH1
PD_13, //D70 - 1:FSMC_A18 / TIM4_CH2 PD_13, //D70 - 1:FSMC_A18 / TIM4_CH2
@ -220,7 +220,7 @@ const PinName digitalPin[] = {
} }
#endif #endif
// ---------------------------------------------------------------------------- // ------------------------
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

@ -98,7 +98,7 @@ const PinName digitalPin[] = {
} }
#endif #endif
// ---------------------------------------------------------------------------- // ------------------------
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

Loading…
Cancel
Save