mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2025-12-28 18:30:36 -07:00
🎨 The Ultraviolet Apostrophe
This commit is contained in:
parent
c941ce1a5b
commit
e1e13ad72c
21 changed files with 56 additions and 56 deletions
|
|
@ -93,15 +93,15 @@ namespace AVRHelpers {
|
|||
typedef T type;
|
||||
};
|
||||
template <typename T>
|
||||
struct voltype <T, 1u> {
|
||||
struct voltype <T, 1U> {
|
||||
typedef uint8_t type;
|
||||
};
|
||||
template <typename T>
|
||||
struct voltype <T, 2u> {
|
||||
struct voltype <T, 2U> {
|
||||
typedef uint16_t type;
|
||||
};
|
||||
template <typename T>
|
||||
struct voltype <T, 4u> {
|
||||
struct voltype <T, 4U> {
|
||||
typedef uint32_t type;
|
||||
};
|
||||
|
||||
|
|
@ -2007,7 +2007,7 @@ inline void _ATmega_resetperipherals() {
|
|||
|
||||
#if defined(__AVR_TRM01__) || defined(__AVR_TRM02__) || defined(__AVR_TRM03__) || defined(__AVR_TRM05__)
|
||||
_EEAR._EEAR = 0;
|
||||
dwrite(_EEDR, (uint8_t)0u);
|
||||
dwrite(_EEDR, (uint8_t)0U);
|
||||
#endif
|
||||
|
||||
#if defined(__AVR_TRM01__) || defined(__AVR_TRM02__) || defined(__AVR_TRM03__) || defined(__AVR_TRM04__) || defined(__AVR_TRM05__)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
// ------------------------
|
||||
|
||||
typedef uint16_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFU
|
||||
|
||||
// ------------------------
|
||||
// Defines
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFUL
|
||||
|
||||
#define HAL_TIMER_PRESCALER 2
|
||||
#define HAL_TIMER_RATE ((F_CPU) / (HAL_TIMER_PRESCALER)) // frequency of timers peripherals
|
||||
|
|
|
|||
|
|
@ -64,10 +64,10 @@
|
|||
#define CRITICAL_SECTION_END() portEXIT_CRITICAL(&hal.spinlock)
|
||||
|
||||
#define HAL_CAN_SET_PWM_FREQ // This HAL supports PWM Frequency adjustment
|
||||
#define PWM_FREQUENCY 1000u // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency()
|
||||
#define PWM_RESOLUTION 10u // Default PWM bit resolution
|
||||
#define CHANNEL_MAX_NUM 15u // max PWM channel # to allocate (7 to only use low speed, 15 to use low & high)
|
||||
#define MAX_PWM_IOPIN 33u // hardware pwm pins < 34
|
||||
#define PWM_FREQUENCY 1000U // Default PWM frequency when set_pwm_duty() is called without set_pwm_frequency()
|
||||
#define PWM_RESOLUTION 10U // Default PWM bit resolution
|
||||
#define CHANNEL_MAX_NUM 15U // max PWM channel # to allocate (7 to only use low speed, 15 to use low & high)
|
||||
#define MAX_PWM_IOPIN 33U // hardware pwm pins < 34
|
||||
#ifndef MAX_EXPANDER_BITS
|
||||
#define MAX_EXPANDER_BITS 32 // I2S expander bit width (max 32)
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ Servo::Servo() {}
|
|||
|
||||
int8_t Servo::attach(const int inPin) {
|
||||
if (inPin > 0) pin = inPin;
|
||||
channel = get_pwm_channel(pin, 50u, 16u);
|
||||
channel = get_pwm_channel(pin, 50U, 16U);
|
||||
return channel; // -1 if no PWM avail.
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
typedef uint64_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFFFFFFFFFULL
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFF'FFFF'FFFF'FFFFULL
|
||||
|
||||
#ifndef MF_TIMER_STEP
|
||||
#define MF_TIMER_STEP 0 // Timer Index for Stepper
|
||||
|
|
@ -52,12 +52,12 @@ typedef uint64_t hal_timer_t;
|
|||
|
||||
#if ENABLED(I2S_STEPPER_STREAM)
|
||||
#define STEPPER_TIMER_PRESCALE 1
|
||||
#define STEPPER_TIMER_RATE 250000 // 250khz, 4µs pulses of i2s word clock
|
||||
#define STEPPER_TIMER_RATE 250'000 // 250khz, 4µs pulses of i2s word clock
|
||||
#else
|
||||
#define STEPPER_TIMER_PRESCALE 40
|
||||
#define STEPPER_TIMER_RATE ((HAL_TIMER_RATE) / (STEPPER_TIMER_PRESCALE)) // frequency of stepper timer, 2MHz
|
||||
#endif
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1'000'000) // stepper timer ticks per µs
|
||||
|
||||
#define STEP_TIMER_MIN_INTERVAL 8 // minimum time in µs between stepper interrupts
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
//
|
||||
typedef Timer0 *timer_channel_t;
|
||||
typedef uint16_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFU
|
||||
|
||||
//
|
||||
// Timer instances
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFUL
|
||||
|
||||
#define HAL_TIMER_RATE ((SystemCoreClock) / 4) // frequency of timers peripherals
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
#define _HAL_TIMER_ISR(T) __HAL_TIMER_ISR(T)
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFUL
|
||||
|
||||
#define HAL_TIMER_RATE ((F_CPU) / 4) // frequency of timers peripherals
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
typedef uint64_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFF'FFFF'FFFF'FFFFULL
|
||||
|
||||
#define HAL_TIMER_RATE ((SystemCoreClock) / 4) // frequency of timers peripherals
|
||||
|
||||
|
|
@ -52,11 +52,11 @@ typedef uint64_t hal_timer_t;
|
|||
#endif
|
||||
#define SYSTICK_TIMER_FREQUENCY 1000
|
||||
|
||||
#define TEMP_TIMER_RATE 1000000
|
||||
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
|
||||
#define TEMP_TIMER_RATE 1'000'000
|
||||
#define TEMP_TIMER_FREQUENCY 1000 // temperature interrupt frequency
|
||||
|
||||
#define STEPPER_TIMER_RATE HAL_TIMER_RATE // frequency of stepper timer (HAL_TIMER_RATE / STEPPER_TIMER_PRESCALE)
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1000000) // stepper timer ticks per µs
|
||||
#define STEPPER_TIMER_TICKS_PER_US ((STEPPER_TIMER_RATE) / 1'000'000) // stepper timer ticks per µs
|
||||
#define STEPPER_TIMER_PRESCALE (CYCLES_PER_MICROSECOND / STEPPER_TIMER_TICKS_PER_US)
|
||||
|
||||
#define PULSE_TIMER_RATE STEPPER_TIMER_RATE // frequency of pulse timer
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@
|
|||
#define _HAL_TIMER_ISR(T) __HAL_TIMER_ISR(T)
|
||||
|
||||
typedef uint64_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFF'FFFF'FFFF'FFFFULL
|
||||
|
||||
#define HAL_TIMER_RATE (1000000ull) // fixed value as we use a microsecond timesource
|
||||
#define HAL_TIMER_RATE (1'000'000ULL) // fixed value as we use a microsecond timesource
|
||||
#ifndef MF_TIMER_STEP
|
||||
#define MF_TIMER_STEP 0 // Timer Index for Stepper
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
// --------------------------------------------------------------------------
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFUL
|
||||
|
||||
#define HAL_TIMER_RATE F_CPU // frequency of timers peripherals
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
// --------------------------------------------------------------------------
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFUL
|
||||
|
||||
#define HAL_TIMER_RATE F_CPU // frequency of timers peripherals
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
*/
|
||||
|
||||
typedef uint16_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFU
|
||||
|
||||
#define HAL_TIMER_RATE uint32_t(F_CPU) // frequency of timers peripherals
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFUL
|
||||
|
||||
#define FTM0_TIMER_PRESCALE 8
|
||||
#define FTM1_TIMER_PRESCALE 4
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFF
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFFUL
|
||||
|
||||
#define FTM0_TIMER_PRESCALE 8
|
||||
#define FTM1_TIMER_PRESCALE 4
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#define FORCE_INLINE __attribute__((always_inline)) inline
|
||||
|
||||
typedef uint32_t hal_timer_t;
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFE
|
||||
#define HAL_TIMER_TYPE_MAX 0xFFFFFFFEUL
|
||||
|
||||
#define GPT_TIMER_RATE (F_CPU / 4) // 150MHz (Can't use F_BUS_ACTUAL because it's extern volatile)
|
||||
|
||||
|
|
|
|||
|
|
@ -867,7 +867,7 @@ namespace MMU3 {
|
|||
nozzle_timer.start();
|
||||
LogEchoEvent(F("Cooling Timeout started"));
|
||||
}
|
||||
else if (nozzle_timer.duration() > (PAUSE_PARK_NOZZLE_TIMEOUT * 1000ul)) { // mins->msec.
|
||||
else if (nozzle_timer.duration() > (PAUSE_PARK_NOZZLE_TIMEOUT * 1000UL)) { // mins->msec.
|
||||
mmu_print_saved &= ~(SavedState::CooldownPending);
|
||||
mmu_print_saved |= SavedState::Cooldown;
|
||||
thermal_setTargetHotend(0);
|
||||
|
|
|
|||
|
|
@ -42,22 +42,22 @@
|
|||
|
||||
#if DISABLED(SD_NO_DEFAULT_TIMEOUT)
|
||||
#ifndef SD_INIT_TIMEOUT
|
||||
#define SD_INIT_TIMEOUT 2000u // (ms) Init timeout
|
||||
#define SD_INIT_TIMEOUT 2000U // (ms) Init timeout
|
||||
#elif SD_INIT_TIMEOUT < 0
|
||||
#error "SD_INIT_TIMEOUT must be greater than or equal to 0."
|
||||
#endif
|
||||
#ifndef SD_ERASE_TIMEOUT
|
||||
#define SD_ERASE_TIMEOUT 10000u // (ms) Erase timeout
|
||||
#define SD_ERASE_TIMEOUT 10000U // (ms) Erase timeout
|
||||
#elif SD_ERASE_TIMEOUT < 0
|
||||
#error "SD_ERASE_TIMEOUT must be greater than or equal to 0."
|
||||
#endif
|
||||
#ifndef SD_READ_TIMEOUT
|
||||
#define SD_READ_TIMEOUT 300u // (ms) Read timeout
|
||||
#define SD_READ_TIMEOUT 300U // (ms) Read timeout
|
||||
#elif SD_READ_TIMEOUT < 0
|
||||
#error "SD_READ_TIMEOUT must be greater than or equal to 0."
|
||||
#endif
|
||||
#ifndef SD_WRITE_TIMEOUT
|
||||
#define SD_WRITE_TIMEOUT 600u // (ms) Write timeout
|
||||
#define SD_WRITE_TIMEOUT 600U // (ms) Write timeout
|
||||
#elif SD_WRITE_TIMEOUT < 0
|
||||
#error "SD_WRITE_TIMEOUT must be greater than or equal to 0."
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -251,14 +251,14 @@ MARLIN_TEST(macros_numeric, NOLESS_int) {
|
|||
|
||||
MARLIN_TEST(macros_numeric, NOLESS_uint) {
|
||||
// Scenario 1: Input was already acceptable
|
||||
unsigned int b = 8u;
|
||||
NOLESS(b, 5u);
|
||||
TEST_ASSERT_EQUAL(8u, b);
|
||||
unsigned int b = 8U;
|
||||
NOLESS(b, 5U);
|
||||
TEST_ASSERT_EQUAL(8U, b);
|
||||
|
||||
// Original scenario: Input was less than the limit
|
||||
b = 5u;
|
||||
NOLESS(b, 10u);
|
||||
TEST_ASSERT_EQUAL(10u, b);
|
||||
b = 5U;
|
||||
NOLESS(b, 10U);
|
||||
TEST_ASSERT_EQUAL(10U, b);
|
||||
}
|
||||
|
||||
MARLIN_TEST(macros_numeric, NOLESS_float) {
|
||||
|
|
@ -310,14 +310,14 @@ MARLIN_TEST(macros_numeric, NOMORE_int) {
|
|||
|
||||
MARLIN_TEST(macros_numeric, NOMORE_uint) {
|
||||
// Scenario 1: Input was already acceptable
|
||||
unsigned int b = 8u;
|
||||
NOMORE(b, 10u);
|
||||
TEST_ASSERT_EQUAL(8u, b);
|
||||
unsigned int b = 8U;
|
||||
NOMORE(b, 10U);
|
||||
TEST_ASSERT_EQUAL(8U, b);
|
||||
|
||||
// Original scenario: Input was more than the limit
|
||||
b = 15u;
|
||||
NOMORE(b, 10u);
|
||||
TEST_ASSERT_EQUAL(10u, b);
|
||||
b = 15U;
|
||||
NOMORE(b, 10U);
|
||||
TEST_ASSERT_EQUAL(10U, b);
|
||||
}
|
||||
|
||||
MARLIN_TEST(macros_numeric, NOMORE_float) {
|
||||
|
|
@ -383,17 +383,17 @@ MARLIN_TEST(macros_numeric, LIMIT_int) {
|
|||
}
|
||||
|
||||
MARLIN_TEST(macros_numeric, LIMIT_uint) {
|
||||
unsigned int b = 15u;
|
||||
LIMIT(b, 10u, 20u);
|
||||
TEST_ASSERT_EQUAL(15u, b);
|
||||
unsigned int b = 15U;
|
||||
LIMIT(b, 10U, 20U);
|
||||
TEST_ASSERT_EQUAL(15U, b);
|
||||
|
||||
b = 5u;
|
||||
LIMIT(b, 10u, 20u);
|
||||
TEST_ASSERT_EQUAL(10u, b);
|
||||
b = 5U;
|
||||
LIMIT(b, 10U, 20U);
|
||||
TEST_ASSERT_EQUAL(10U, b);
|
||||
|
||||
b = 25u;
|
||||
LIMIT(b, 10u, 20u);
|
||||
TEST_ASSERT_EQUAL(20u, b);
|
||||
b = 25U;
|
||||
LIMIT(b, 10U, 20U);
|
||||
TEST_ASSERT_EQUAL(20U, b);
|
||||
}
|
||||
|
||||
MARLIN_TEST(macros_numeric, LIMIT_float) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
MARLIN_TEST(runout, poll_runout_states) {
|
||||
FilamentSensorBase sensor;
|
||||
// Expected default value is one bit set for each extruder
|
||||
uint8_t expected = static_cast<uint8_t>(~(~0u << NUM_RUNOUT_SENSORS));
|
||||
uint8_t expected = static_cast<uint8_t>(~(~0U << NUM_RUNOUT_SENSORS));
|
||||
TEST_ASSERT_EQUAL(expected, sensor.poll_runout_states());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue