Clean up section comments
This commit is contained in:
@ -27,22 +27,14 @@
|
||||
|
||||
#ifdef __STM32F1__
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "HAL.h"
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include <STM32ADC.h>
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Externals
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#define __I
|
||||
#define __IO volatile
|
||||
@ -70,13 +62,10 @@
|
||||
__IO uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
|
||||
} SCB_Type;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Variables
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Local defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#define SCS_BASE (0xE000E000UL) /*!< System Control Space 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_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#ifdef SERIAL_USB
|
||||
USBSerial SerialUSB;
|
||||
#endif
|
||||
|
||||
uint16_t HAL_adc_result;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Private Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
STM32ADC adc(ADC1);
|
||||
|
||||
uint8_t adc_pins[] = {
|
||||
@ -166,13 +156,13 @@ enum TEMP_PINS : char {
|
||||
|
||||
uint16_t HAL_adc_results[ADC_PIN_COUNT];
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Function prototypes
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Private functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
static void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) {
|
||||
uint32_t reg_value;
|
||||
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;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
//
|
||||
// Leave PA11/PA12 intact if USBSerial is not used
|
||||
@ -263,9 +253,9 @@ extern "C" {
|
||||
}
|
||||
*/
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// ADC
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Init the AD in continuous capture mode
|
||||
void HAL_adc_init(void) {
|
||||
// configure the ADC
|
||||
|
@ -32,10 +32,6 @@
|
||||
#define vsnprintf_P vsnprintf
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "../../core/macros.h"
|
||||
#include "../shared/Marduino.h"
|
||||
#include "../shared/math_32bit.h"
|
||||
@ -51,9 +47,9 @@
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#ifdef SERIAL_USB
|
||||
#define UsbSerial Serial
|
||||
@ -156,22 +152,22 @@ void HAL_init(void);
|
||||
#define RST_SOFTWARE 32
|
||||
#define RST_BACKUP 64
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
typedef int8_t pin_t;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
/** result of last ADC conversion */
|
||||
extern uint16_t HAL_adc_result;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
// Disable interrupts
|
||||
#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; }
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// SD Commands and Responses
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
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); }
|
||||
|
@ -21,18 +21,14 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "../shared/Marduino.h"
|
||||
|
||||
#include "libmaple/sdio.h"
|
||||
#include "libmaple/dma.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#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. */
|
||||
@ -106,9 +102,9 @@
|
||||
|
||||
#define SDIO_CLOCK 18000000 /* 18 MHz */
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
typedef struct {
|
||||
uint32_t CardType; // Card Type
|
||||
@ -121,9 +117,9 @@ typedef struct {
|
||||
uint32_t LogBlockSize; // Logical block size in bytes
|
||||
} SDIO_CardInfoTypeDef;
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
inline uint32_t SDIO_GetCardState(void);
|
||||
|
||||
|
@ -32,34 +32,25 @@
|
||||
|
||||
#ifdef __STM32F1__
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
#include <SPI.h>
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
#if ENABLED(SOFTWARE_SPI)
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Software SPI
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
#error "Software SPI not supported for STM32F1. Use hardware SPI."
|
||||
|
||||
#else
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Hardware SPI
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
/**
|
||||
* VGPV SPI speed start and F_CPU/2, by default 72/2 = 36Mhz
|
||||
|
@ -26,45 +26,17 @@
|
||||
|
||||
#ifdef __STM32F1__
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "HAL.h"
|
||||
|
||||
#include "HAL_timers_STM32F1.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Externals
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Local defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Private Variables
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Function prototypes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Private functions
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
/**
|
||||
* Timer_clock1: Prescaler 2 -> 36 MHz
|
||||
|
@ -25,16 +25,12 @@
|
||||
* HAL for stm32duino.com based on Libmaple and compatible (STM32F1)
|
||||
*/
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Includes
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include <stdint.h>
|
||||
#include <libmaple/timer.h>
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Defines
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
/**
|
||||
* 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 stepTC_Handler(void);
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
/*
|
||||
static HardwareTimer StepperTimer(STEP_TIMER_NUM);
|
||||
static HardwareTimer TempTimer(TEMP_TIMER_NUM);
|
||||
*/
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
//static HardwareTimer StepperTimer(STEP_TIMER_NUM);
|
||||
//static HardwareTimer TempTimer(TEMP_TIMER_NUM);
|
||||
|
||||
// ------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
// ------------------------
|
||||
|
||||
void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency);
|
||||
void HAL_timer_enable_interrupt(const uint8_t timer_num);
|
||||
|
Reference in New Issue
Block a user