1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-09-01 18:32:37 +02:00

Tightened up sloppy returns (#577)

* Tightened up sloppy returns

No semantic change.

* Added parentheses
This commit is contained in:
Mitch Bradley
2020-09-05 08:28:59 -10:00
committed by GitHub
parent c7ff176ec4
commit 89fa85dac0
3 changed files with 4 additions and 19 deletions

View File

@@ -241,10 +241,7 @@ float plan_get_exec_block_exit_speed_sqr() {
// Returns the availability status of the block ring buffer. True, if full.
uint8_t plan_check_full_buffer() {
if (block_buffer_tail == next_buffer_head) {
return true;
}
return false;
return block_buffer_tail == next_buffer_head;
}
// Computes and returns block nominal speed based on running condition and override values.

View File

@@ -782,11 +782,7 @@ void st_parking_restore_buffer() {
// Increments the step segment buffer block data ring buffer.
static uint8_t st_next_block_index(uint8_t block_index) {
block_index++;
if (block_index == (SEGMENT_BUFFER_SIZE - 1)) {
return 0;
} else {
return block_index;
}
return block_index == (SEGMENT_BUFFER_SIZE - 1) ? 0 : block_index;
}
/* Prepares step segment buffer. Continuously called from main program.
@@ -1227,11 +1223,7 @@ void st_prep_buffer() {
// in the segment buffer. It will always be behind by up to the number of segment blocks (-1)
// divided by the ACCELERATION TICKS PER SECOND in seconds.
float st_get_realtime_rate() {
if (sys.state & (STATE_CYCLE | STATE_HOMING | STATE_HOLD | STATE_JOG | STATE_SAFETY_DOOR)) {
return prep.current_speed;
} else {
return 0.0f;
}
return (sys.state & (STATE_CYCLE | STATE_HOMING | STATE_HOLD | STATE_JOG | STATE_SAFETY_DOOR)) ? prep.current_speed : 0.0f;
}
void IRAM_ATTR Stepper_Timer_WritePeriod(uint64_t alarm_val) {

View File

@@ -1223,11 +1223,7 @@ namespace WebUI {
COMMANDS::wait(0); //wdtFeed
}
file.close();
if (result) {
return SD.rmdir(path);
} else {
return false;
}
return result ? SD.rmdir(path) : false;
}
//direct SD files list//////////////////////////////////////////////////