Skip to content

[BUG] Warning: conversion from 'uint32_t' in Stepper::isr() #28156

@classicrocker883

Description

@classicrocker883

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

Warning given during compile.

  • line 1589: interval = uint32_t(STEPPER_TIMER_RATE * 0.030);
.Marlin/src/module/stepper.cpp: In static member function 'static void Stepper::isr()':
Marlin/src/module/stepper.cpp:1589:18: warning: conversion from 'uint32_t' {aka 'long unsigned int'} to 'hal_timer_t' {aka 'short unsigned int'} changes value from '120000' to '54464' [-Woverflow]

the function has it as hal_timer_t interval = 0; this effected by STM32F1 and HC32 that I know of, because these are typedef uint16_t hal_timer_t;

a simple fix would be to make hal_timer_t => uint32_t but that can effect other things, I figure that since other hal_timer_t HAL's are uint32_t or uint64_t

Bug Timeline

🐛 Fix some FT Motion probing issues (#28096) 252085f ·

Expected behavior

No warning

Actual behavior

Get warning at compile

Steps to Reproduce

  1. Load up a configuration like Ender-3 V2 (which is what I used)
  2. Use STM32F1 env
  3. Compile

Version of Marlin Firmware

bugfix-2.1.x

Printer model

Voxleab Aquila

Electronics

No response

LCD/Controller

No response

Other add-ons

No response

Bed Leveling

None

Your Slicer

None

Host Software

None

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions