MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.34k stars 19.26k forks source link

[BUG] [2.0] EXTRA_LIN_ADVANCE_K: 'bitRead' was not declared in this scope #13989

Closed LastDragon-ru closed 5 years ago

LastDragon-ru commented 5 years ago

Description

Marlin\src\gcode\feature\advance\M900.cpp: In static member function 'static void GcodeSuite::M900()':
Marlin\src\gcode\feature\advance\M900.cpp:58:21: error: 'bitRead' was not declared in this scope
bool ext_slot = bitRead(lin_adv_slot, tmp_extruder);
^~~~~~~
Marlin\src\gcode\feature\advance\M900.cpp:58:21: note: suggested alternative: 'spiRead'
bool ext_slot = bitRead(lin_adv_slot, tmp_extruder);
^~~~~~~
spiRead
Marlin\src\gcode\feature\advance\M900.cpp:64:9: error: 'bitWrite' was not declared in this scope
bitWrite(lin_adv_slot, tmp_extruder, slot);
^~~~~~~~
Marlin\src\gcode\feature\advance\M900.cpp:64:9: note: suggested alternative: 'finite'
bitWrite(lin_adv_slot, tmp_extruder, slot);
^~~~~~~~
finite
Compiling .pioenvs\LPC1768\src\src\gcode\feature\fwretract\G10_G11.cpp.o
*** [.pioenvs\LPC1768\src\src\gcode\feature\advance\M900.cpp.o] Error 1

Steps to Reproduce

  1. Uncomment #define EXTRA_LIN_ADVANCE_K
  2. Compile

Additional Information

MKS SBase + Marlin 2 (https://github.com/MarlinFirmware/Marlin/commit/940ff8e7c8a5919681dcd6d6e87668381010151a) + vs code + platformio (all libs updated)

ghost commented 5 years ago

I confirm. Same here. If EXTRA_LIN_ADVANCE_K is enabled, the code uses bitRead and bitWrite, which is part of the platformio-pkg-framework-arduinosam, wiring.h. Not present/referenced in the LPC1768 env.

If you need it urgently, just put these in M900.cpp at the top somewhere until this gets fixed by someone:

  #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
  #define bitSet(value, bit) ((value) |= (1UL << (bit)))
  #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
  #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
SJ-Innovation commented 5 years ago

Oop! On it!

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.