mirror of
https://github.com/grblHAL/core.git
synced 2026-08-18 17:07:20 +08:00
Changed deprecated calls to isinff() and isnanf() to new (C99) versions.
This commit is contained in:
+19
-1
@@ -1,5 +1,23 @@
|
||||
## grblHAL changelog
|
||||
|
||||
<a name="20241204"> 20241204
|
||||
|
||||
Core:
|
||||
|
||||
* Changed deprecated calls to `isinff()` and `isnanf()` to new \(C99\) versions.
|
||||
|
||||
Drivers:
|
||||
|
||||
* RP2040: CMakeLists.txt fixes for RP2350 builds.
|
||||
|
||||
* STM32F4xx: disabled broken support for sensorless homing for LongBoard32 \(SLB\). Support for this board is still WIP.
|
||||
|
||||
Plugins:
|
||||
|
||||
* Motors , spindle and misc: Changed deprecated calls to `isinff()` and `isnanf()` to new \(C99\) versions.
|
||||
|
||||
---
|
||||
|
||||
<a name="20241128">Build 20241128
|
||||
|
||||
Core:
|
||||
@@ -20,7 +38,7 @@ Drivers:
|
||||
|
||||
Plugins:
|
||||
|
||||
* Trinamic: removed superfluous semicolon.Ref. [issue #15](https://github.com/grblHAL/Plugins_motor/issues/15).
|
||||
* Trinamic: removed superfluous semicolon. Ref. [issue #15](https://github.com/grblHAL/Plugins_motor/issues/15).
|
||||
|
||||
* Networking: added some files to _CMakeLists.txt_, used by RP2350 driver.
|
||||
|
||||
|
||||
@@ -940,7 +940,7 @@ status_code_t gc_execute_block (char *block)
|
||||
if(gc_state.skip_blocks && letter != 'O')
|
||||
return Status_OK;
|
||||
|
||||
if(user_mcode != UserMCode_NoValueWords && isnanf(value))
|
||||
if(user_mcode != UserMCode_NoValueWords && isnan(value))
|
||||
FAIL(Status_BadNumberFormat); // [Expected word value]
|
||||
|
||||
g65_words.value = 0;
|
||||
@@ -969,7 +969,7 @@ status_code_t gc_execute_block (char *block)
|
||||
// a good enough compromise and catch most all non-integer errors. To make it compliant,
|
||||
// we would simply need to change the mantissa to int16, but this add compiled flash space.
|
||||
// Maybe update this later.
|
||||
if(!isnanf(value)) {
|
||||
if(!isnan(value)) {
|
||||
int_value = (uint32_t)truncf(value);
|
||||
mantissa = (uint_fast16_t)roundf(100.0f * (value - int_value));
|
||||
}
|
||||
@@ -2600,7 +2600,7 @@ status_code_t gc_execute_block (char *block)
|
||||
// TODO: fail?
|
||||
}
|
||||
|
||||
if(thread.end_taper_type != Taper_None && thread.end_taper_length > abs(thread.z_final - gc_state.position[Z_AXIS]) / 2.0f)
|
||||
if(thread.end_taper_type != Taper_None && thread.end_taper_length > fabsf(thread.z_final - gc_state.position[Z_AXIS]) / 2.0f)
|
||||
FAIL(Status_GcodeValueOutOfRange);
|
||||
|
||||
if(gc_block.words.r)
|
||||
|
||||
+2
-2
@@ -322,7 +322,7 @@ static void get_cuboid_envelope (void)
|
||||
for(z = 0; z < settings.axis[X_AXIS].steps_per_mm * 2.0f * M_PI ; ++z) {
|
||||
pos[0] = pos[1] = pos[2] = sr * (float)z;
|
||||
transform_to_cartesian(mpos.values, pos);
|
||||
if(!isnanf(mpos.x)) {
|
||||
if(!isnan(mpos.x)) {
|
||||
if(minz > mpos.z)
|
||||
minz = mpos.z;
|
||||
if(maxz < mpos.z)
|
||||
@@ -589,7 +589,7 @@ static bool delta_check_travel_limits (float *target, axes_signals_t axes, bool
|
||||
#endif
|
||||
|
||||
if(!is_cartesian) {
|
||||
if(isnanf(transform_to_cartesian(pos.values, target)[A_MOTOR]))
|
||||
if(isnan(transform_to_cartesian(pos.values, target)[A_MOTOR]))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -820,9 +820,9 @@ status_code_t ngc_read_real_value (char *line, uint_fast8_t *pos, float *value)
|
||||
else
|
||||
status = (read_float(line, pos, value) ? Status_OK : Status_BadNumberFormat);
|
||||
|
||||
if(isnanf(*value))
|
||||
if(isnan(*value))
|
||||
status = Status_ExpressionInvalidResult; // Calculation resulted in 'not a number'
|
||||
else if(isinff(*value))
|
||||
else if(isinf(*value))
|
||||
status = Status_ExpressionInvalidResult; // Calculation resulted in 'not a number'
|
||||
|
||||
return status;
|
||||
|
||||
+1
-1
@@ -306,7 +306,7 @@ bool read_float (char *line, uint_fast8_t *char_counter, float *float_ptr)
|
||||
// Returns true if float value is a whole number (integer)
|
||||
bool isintf (float value)
|
||||
{
|
||||
return !isnanf(value) && fabsf(value - truncf(value)) < 0.001f;
|
||||
return !isnan(value) && fabsf(value - truncf(value)) < 0.001f;
|
||||
}
|
||||
|
||||
// Non-blocking delay function used for general operation and suspend features.
|
||||
|
||||
@@ -64,11 +64,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__MSP430F5529__) || defined(__MSP432P401R__) || defined(__MSP432E401Y__) || defined(PART_TM4C123GH6PM) || defined(PART_TM4C1294NCPDT)
|
||||
#define isnanf(x) __isnanf(x)
|
||||
#define isinff(x) __isinff(x)
|
||||
#endif
|
||||
|
||||
// Axis array index values. Must start with 0 and be continuous.
|
||||
#define X_AXIS 0 // Axis indexing value.
|
||||
#define Y_AXIS 1
|
||||
|
||||
Reference in New Issue
Block a user