Clean up section comments
This commit is contained in:
@ -22,10 +22,6 @@
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "HAL.h"
|
||||
#include <rom/rtc.h>
|
||||
#include <driver/adc.h>
|
||||
@ -48,49 +44,33 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Externals
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Local defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#define V_REF 1100
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Variables
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
uint16_t HAL_adc_result;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Private Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
esp_adc_cal_characteristics_t characteristics;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Private functions
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
void HAL_init(void) {
|
||||
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
|
||||
int freeMemory() { return ESP.getFreeHeap(); }
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// ADC
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
#define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL
|
||||
|
||||
adc1_channel_t get_channel(int pin) {
|
||||
|
@ -24,10 +24,6 @@
|
||||
|
||||
#define CPU_32_BIT
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
@ -43,9 +39,9 @@
|
||||
#include "WebSocketSerial.h"
|
||||
#include "FlushableHardwareSerial.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
extern portMUX_TYPE spinlock;
|
||||
|
||||
@ -69,24 +65,24 @@ extern portMUX_TYPE spinlock;
|
||||
#undef pgm_read_ptr
|
||||
#define pgm_read_ptr(addr) (*(addr))
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
typedef int16_t pin_t;
|
||||
|
||||
#define HAL_SERVO_LIB Servo
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
/** result of last ADC conversion */
|
||||
extern uint16_t HAL_adc_result;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
// clear reset reason
|
||||
void HAL_clear_reset_source (void);
|
||||
|
@ -23,10 +23,6 @@
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "HAL.h"
|
||||
#include "../shared/HAL_SPI.h"
|
||||
#include <pins_arduino.h>
|
||||
@ -34,28 +30,28 @@
|
||||
#include "../../core/macros.h"
|
||||
#include <SPI.h>
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
static SPISettings spiConfig;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(SOFTWARE_SPI)
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Software SPI
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
#error "Software SPI not supported for ESP32. Use Hardware SPI."
|
||||
|
||||
#else
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Hardware SPI
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
void spiBegin() {
|
||||
#if !PIN_EXISTS(SS)
|
||||
|
@ -22,10 +22,6 @@
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#include "esp_types.h"
|
||||
#include "soc/timer_group_struct.h"
|
||||
@ -36,28 +32,15 @@
|
||||
|
||||
#include "HAL_timers_ESP32.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Externals
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Local defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#define NUM_HARDWARE_TIMERS 4
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Private Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Private functions
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
void IRAM_ATTR timer_group0_isr(void *para) {
|
||||
const int timer_idx = (int)para;
|
||||
|
@ -21,10 +21,6 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include <stdint.h>
|
||||
#include "driver/timer.h"
|
||||
|
||||
@ -33,9 +29,9 @@
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include "../../pins/pins.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
//
|
||||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
@ -81,9 +77,9 @@ extern "C" void tempTC_Handler(void);
|
||||
extern "C" void stepTC_Handler(void);
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
typedef struct {
|
||||
timer_group_t group;
|
||||
@ -92,15 +88,15 @@ typedef struct {
|
||||
void (*fn)(void);
|
||||
} tTimerConfig;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
extern const tTimerConfig TimerConfig[];
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
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);
|
||||
|
Reference in New Issue
Block a user