diff --git a/CMakeLists.txt b/CMakeLists.txt index 23a91e6751..609c575e81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,7 +252,7 @@ set(FW_SOURCES SdFatUtil.cpp SdFile.cpp SdVolume.cpp - sm4.c + sm4.cpp sound.cpp speed_lookuptable.cpp spi.c diff --git a/Firmware/sm4.c b/Firmware/sm4.cpp similarity index 97% rename from Firmware/sm4.c rename to Firmware/sm4.cpp index 45ecb46130..009875f951 100644 --- a/Firmware/sm4.c +++ b/Firmware/sm4.cpp @@ -1,5 +1,4 @@ -//sm4.c - simple 4-axis stepper control - +//sm4.cpp - simple 4-axis stepper control #include "sm4.h" #include #include @@ -70,7 +69,7 @@ void sm4_set_dir(uint8_t axis, uint8_t dir) void sm4_set_dir_bits(uint8_t dir_bits) { - register uint8_t portL = PORTL; + uint8_t portL = PORTL; portL &= 0xb8; //set direction bits to zero //TODO -optimize in asm #if ((MOTHERBOARD == BOARD_RAMBO_MINI_1_0) || (MOTHERBOARD == BOARD_RAMBO_MINI_1_3)) @@ -96,7 +95,7 @@ void sm4_do_step(uint8_t axes_mask) #ifdef TMC2130_DEDGE_STEPPING PINC = (axes_mask & 0x0f); // toggle step signals by mask #else - register uint8_t portC = PORTC & 0xf0; + uint8_t portC = PORTC & 0xf0; PORTC = portC | (axes_mask & 0x0f); //set step signals by mask asm("nop"); PORTC = portC; //set step signals to zero diff --git a/Firmware/sm4.h b/Firmware/sm4.h index a1897bca26..da834f73de 100644 --- a/Firmware/sm4.h +++ b/Firmware/sm4.h @@ -5,12 +5,6 @@ #include #include "config.h" - -#if defined(__cplusplus) -extern "C" { -#endif //defined(__cplusplus) - - // callback prototype for stop condition (return 0 - continue, return 1 - stop) typedef uint8_t (*sm4_stop_cb_t)();