Browse Source

Fix get_period_inverse(0) so it doesn't crash (#11334)

pull/1/head
Eyal 6 years ago
committed by Scott Lahteine
parent
commit
fbdbe53290
  1. 4
      Marlin/src/module/planner.cpp

4
Marlin/src/module/planner.cpp

@ -694,7 +694,9 @@ void Planner::init() {
// All other 32-bit MPUs can easily do inverse using hardware division,
// so we don't need to reduce precision or to use assembly language at all.
// This routine, for all other archs, returns 0x100000000 / d ~= 0xFFFFFFFF / d
static FORCE_INLINE uint32_t get_period_inverse(const uint32_t d) { return 0xFFFFFFFF / d; }
static FORCE_INLINE uint32_t get_period_inverse(const uint32_t d) {
return d ? 0xFFFFFFFF / d : 0xFFFFFFFF;
}
#endif
#endif

Loading…
Cancel
Save