Skip to content

Commit

Permalink
🎨 Fix some formatting, F() versus PSTR()
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jul 25, 2021
1 parent 4b94fb7 commit e1907a9
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LINUX/hardware/Gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct GpioEvent {
pin_type pin_id;
GpioEvent::Type event;

GpioEvent(uint64_t timestamp, pin_type pin_id, GpioEvent::Type event){
GpioEvent(uint64_t timestamp, pin_type pin_id, GpioEvent::Type event) {
this->timestamp = timestamp;
this->pin_id = pin_id;
this->event = event;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LINUX/hardware/LinearAxis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void LinearAxis::update() {
}

void LinearAxis::interrupt(GpioEvent ev) {
if (ev.pin_id == step_pin && !Gpio::pin_map[enable_pin].value){
if (ev.pin_id == step_pin && !Gpio::pin_map[enable_pin].value) {
if (ev.event == GpioEvent::RISE) {
last_update = ev.timestamp;
position += -1 + 2 * Gpio::pin_map[dir_pin].value;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LINUX/hardware/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Timer {
return (*(intptr_t*)timerid);
}

static void handler(int sig, siginfo_t *si, void *uc){
static void handler(int sig, siginfo_t *si, void *uc) {
Timer* _this = (Timer*)si->si_value.sival_ptr;
_this->avg_error += (Clock::nanos() - _this->start_time) - _this->period; //high_resolution_clock is also limited in precision, but best we have
_this->avg_error /= 2; //very crude precision analysis (actually within +-500ns usually)
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/leds/pca9533.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ void PCA9533_init() {
PCA9533_reset();
}

static void PCA9533_writeAllRegisters(uint8_t psc0, uint8_t pwm0, uint8_t psc1, uint8_t pwm1, uint8_t ls0){
static void PCA9533_writeAllRegisters(uint8_t psc0, uint8_t pwm0, uint8_t psc1, uint8_t pwm1, uint8_t ls0) {
uint8_t data[6] = { PCA9533_REG_PSC0 | PCA9533_REGM_AI, psc0, pwm0, psc1, pwm1, ls0 };
Wire.beginTransmission(PCA9533_Addr >> 1);
Wire.write(data, 6);
Wire.endTransmission();
delayMicroseconds(1);
}

static void PCA9533_writeRegister(uint8_t reg, uint8_t val){
static void PCA9533_writeRegister(uint8_t reg, uint8_t val) {
uint8_t data[2] = { reg, val };
Wire.beginTransmission(PCA9533_Addr >> 1);
Wire.write(data, 2);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ bool Power::psu_on;
* Initialize pins & state for the power manager.
*
*/
void Power::init(){
void Power::init() {
psu_on = ENABLED(PSU_DEFAULT_OFF); // Set opposite state to get full power_off/on
TERN(PSU_DEFAULT_OFF, power_off(), power_on());
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void GcodeSuite::G28() {
#endif

#if HAS_HOMING_CURRENT
auto debug_current = [](PGM_P const s, const int16_t a, const int16_t b){
auto debug_current = [](PGM_P const s, const int16_t a, const int16_t b) {
DEBUG_ECHOPGM_P(s); DEBUG_ECHOLNPAIR(" current: ", a, " -> ", b);
};
#if HAS_CURRENT_HOME(X)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool BioConfirmHomeE::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1:
#if defined(AXIS_LEVELING_COMMANDS) && defined(PARK_AND_RELEASE_COMMANDS)
SpinnerDialogBox::enqueueAndWait_P(F(
SpinnerDialogBox::enqueueAndWait_P(PSTR(
"G28 E\n"
AXIS_LEVELING_COMMANDS "\n"
PARK_AND_RELEASE_COMMANDS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bool BioConfirmHomeXYZ::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1:
#ifdef PARK_AND_RELEASE_COMMANDS
SpinnerDialogBox::enqueueAndWait_P(F(
SpinnerDialogBox::enqueueAndWait_P(PSTR(
"G28\n"
PARK_AND_RELEASE_COMMANDS
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ bool MainMenu::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
case 2: GOTO_SCREEN(BioConfirmHomeXYZ); break;
case 3: SpinnerDialogBox::enqueueAndWait_P(e_homed ? F("G0 E0 F120") : F("G112")); break;
case 3: SpinnerDialogBox::enqueueAndWait_P(e_homed ? PSTR("G0 E0 F120") : PSTR("G112")); break;
case 4: StatusScreen::unlockMotors(); break;
#ifdef AXIS_LEVELING_COMMANDS
case 5: SpinnerDialogBox::enqueueAndWait_P(F(AXIS_LEVELING_COMMANDS)); break;
case 5: SpinnerDialogBox::enqueueAndWait_P(PSTR(AXIS_LEVELING_COMMANDS)); break;
#endif
case 6: GOTO_SCREEN(TemperatureScreen); break;
case 7: GOTO_SCREEN(InterfaceSettingsScreen); break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ bool StatusScreen::onTouchEnd(uint8_t tag) {
case 9: GOTO_SCREEN(FilesScreen); break;
case 10: GOTO_SCREEN(MainMenu); break;
case 13: GOTO_SCREEN(BioConfirmHomeE); break;
case 14: SpinnerDialogBox::enqueueAndWait_P(F("G28Z")); break;
case 14: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28Z")); break;
case 15: GOTO_SCREEN(TemperatureScreen); break;
case 16: fine_motion = !fine_motion; break;
default: return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bool TuneMenu::onTouchEnd(uint8_t tag) {
case 3: GOTO_SCREEN(TemperatureScreen); break;
case 4: GOTO_SCREEN(NudgeNozzleScreen); break;
case 5: GOTO_SCREEN(BioConfirmHomeXYZ); break;
case 6: SpinnerDialogBox::enqueueAndWait_P(F("G0 E0 F120")); break;
case 6: SpinnerDialogBox::enqueueAndWait_P(PSTR("G0 E0 F120")); break;
case 7: StatusScreen::unlockMotors(); break;
default:
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
case 3: BedMeshViewScreen::show(); break;
case 4: BedMeshEditScreen::show(); break;
case 5: injectCommands_P(PSTR("M280 P0 S60")); break;
case 6: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
case 6: SpinnerDialogBox::enqueueAndWait_P(PSTR("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
default: return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ bool StatusScreen::onTouchStart(uint8_t) {

bool StatusScreen::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: SpinnerDialogBox::enqueueAndWait_P(F("G28 O\nG27")); break;
case 1: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28 O\nG27")); break;
case 2: GOTO_SCREEN(LoadChocolateScreen); break;
case 3: GOTO_SCREEN(PreheatMenu); break;
case 4: GOTO_SCREEN(MainMenu); break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bool BedMeshEditScreen::onTouchEnd(uint8_t tag) {

void BedMeshEditScreen::show() {
// On entry, always home (to account for possible Z offset changes) and save current mesh
SpinnerDialogBox::enqueueAndWait_P(F("G28\nG29 S1"));
SpinnerDialogBox::enqueueAndWait_P(PSTR("G28\nG29 S1"));
// After the spinner, go to this screen.
current_screen.forget();
PUSH_SCREEN(BedMeshEditScreen);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
switch (tag) {
case 1: GOTO_PREVIOUS(); break;
#if EITHER(Z_STEPPER_AUTO_ALIGN,MECHANICAL_GANTRY_CALIBRATION)
case 2: SpinnerDialogBox::enqueueAndWait_P(F("G34")); break;
case 2: SpinnerDialogBox::enqueueAndWait_P(PSTR("G34")); break;
#endif
#if HAS_BED_PROBE
case 3:
Expand All @@ -114,7 +114,7 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
#if ENABLED(AUTO_BED_LEVELING_UBL)
BedMeshViewScreen::doProbe();
#else
SpinnerDialogBox::enqueueAndWait_P(F(BED_LEVELING_COMMANDS));
SpinnerDialogBox::enqueueAndWait_P(PSTR(BED_LEVELING_COMMANDS));
#endif
break;
#endif
Expand All @@ -127,7 +127,7 @@ bool LevelingMenu::onTouchEnd(uint8_t tag) {
#endif
#if ENABLED(BLTOUCH)
case 7: injectCommands_P(PSTR("M280 P0 S60")); break;
case 8: SpinnerDialogBox::enqueueAndWait_P(F("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
case 8: SpinnerDialogBox::enqueueAndWait_P(PSTR("M280 P0 S90\nG4 P100\nM280 P0 S120")); break;
#endif
default: return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool MainMenu::onTouchEnd(uint8_t tag) {

switch (tag) {
case 1: SaveSettingsDialogBox::promptToSaveSettings(); break;
case 2: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break;
case 2: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28")); break;
#if ENABLED(NOZZLE_CLEAN_FEATURE)
case 3: injectCommands_P(PSTR("G12")); GOTO_SCREEN(StatusScreen); break;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ bool BaseMoveAxisScreen::onTouchHeld(uint8_t tag) {
case 14: UI_DECREMENT_AXIS(E3); mydata.e_rel[3] -= increment; break;
case 15: UI_INCREMENT_AXIS(E3); mydata.e_rel[3] += increment; break;
#endif
case 20: SpinnerDialogBox::enqueueAndWait_P(F("G28X")); break;
case 21: SpinnerDialogBox::enqueueAndWait_P(F("G28Y")); break;
case 22: SpinnerDialogBox::enqueueAndWait_P(F("G28Z")); break;
case 23: SpinnerDialogBox::enqueueAndWait_P(F("G28")); break;
case 20: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28X")); break;
case 21: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28Y")); break;
case 22: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28Z")); break;
case 23: SpinnerDialogBox::enqueueAndWait_P(PSTR("G28")); break;
case 24: raiseZtoTop(); break;
default:
return false;
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/libs/hex_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void print_hex_address(const void * const w) { SERIAL_ECHO(hex_address(w)); }

void print_hex_long(const uint32_t w, const char delimiter) {
SERIAL_ECHOPGM("0x");
for (int B = 24; B >= 8; B -= 8){
for (int B = 24; B >= 8; B -= 8) {
print_hex_byte(w >> B);
SERIAL_CHAR(delimiter);
}
Expand Down

0 comments on commit e1907a9

Please sign in to comment.