Skip to content

Commit

Permalink
minor code corrections
Browse files Browse the repository at this point in the history
-fixed warnings on SAMD21 (CACHEDIS reset and math.h missing)
-modified tool length settings range eval
-added setting for clone Bluepill on platformIO
  • Loading branch information
Paciente8159 committed Apr 9, 2022
1 parent 880d199 commit dedcda5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ windows/uCNCgui/obj/Debug/net6.0-windows/uCNCgui.GeneratedMSBuildEditorConfig.ed
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
.vscode/launch.json
.vscode/extensions.json
2 changes: 2 additions & 0 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ platform = ststm32
board = bluepill_f103c8
framework = arduino
build_flags = -D BOARD=BOARD_BLUEPILL -D INTERFACE=1 -D HAL_TIM_MODULE_DISABLED -D HAL_EXTI_MODULE_DISABLED -fdata-sections -ffunction-sections -Wl,--gc-sections
;uncomment if it's a bluepill clone
;upload_flags = -c set CPUTAPID 0x2ba01477

[env:blackpill_f401cc]
platform = ststm32
Expand Down
3 changes: 2 additions & 1 deletion uCNC/src/hal/mcus/samd21/mcu_samd21.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "sam.h"
//#include "instance/nvmctrl.h"
#include <string.h>
#include <math.h>

// Non volatile memory
// SAMD devices page size never exceeds 1024 bytes
Expand Down Expand Up @@ -1739,7 +1740,7 @@ void mcu_eeprom_flush(void)
remaining -= (remaining > NVM_ROW_SIZE) ? NVM_ROW_SIZE : remaining;
}

NVMCTRL->CTRLB.bit.CACHEDIS = 1;
NVMCTRL->CTRLB.bit.CACHEDIS = cache;
NVMCTRL->CTRLB.bit.RWS = 0x01;
}

Expand Down
2 changes: 1 addition & 1 deletion uCNC/src/interface/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ uint8_t settings_change(uint8_t setting, float value)
}
#endif
#if TOOL_COUNT > 0
else if (setting > 80 && setting <= 96)
else if (setting > 80 && setting <= (80 + TOOL_COUNT))
{
setting -= 80;
g_settings.tool_length_offset[setting] = value;
Expand Down

0 comments on commit dedcda5

Please sign in to comment.