Fix missing Bitmask in F0-F4 function evaluation, Handle NULL-pointer in get_direction(), CMakelists.txt disable optimizing, Upload CLion config
This commit is contained in:
1 parent
27d68d3d24
commit
c8b75ee71f
8 files changed
+48
-5
No files matched your search
@@ -1,4 +1,3 @@
|
||||
.idea
|
||||
.vscode
|
||||
build
|
||||
cmake-build-debug
|
||||
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Generated
+2
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
Generated
+4
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/RP2040-Decoder.iml" filepath="$PROJECT_DIR$/.idea/RP2040-Decoder.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+13
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../../../../Program Files/Raspberry Pi/Pico SDK v1.5.1/pico-sdk" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../../../../Program Files/Raspberry Pi/Pico SDK v1.5.1/pico-sdk/lib/btstack" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../../../../Program Files/Raspberry Pi/Pico SDK v1.5.1/pico-sdk/lib/cyw43-driver" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../../../../Program Files/Raspberry Pi/Pico SDK v1.5.1/pico-sdk/lib/lwip" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../../../../Program Files/Raspberry Pi/Pico SDK v1.5.1/pico-sdk/lib/mbedtls" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../../../../Program Files/Raspberry Pi/Pico SDK v1.5.1/pico-sdk/lib/tinyusb" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$/../../../../Program Files/Raspberry Pi/Pico SDK v1.5.1/pico-sdk/lib/tinyusb/hw/mcu/raspberry_pi/Pico-PIO-USB" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -9,6 +9,9 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
set(PICO_DECODER_PATH ${PROJECT_SOURCE_DIR})
|
||||
|
||||
# Stop the compiler from inling method calls making it easier to debug
|
||||
set(PICO_DEOPTIMIZED_DEBUG 1)
|
||||
|
||||
# Initialize the SDK
|
||||
pico_sdk_init()
|
||||
|
||||
|
||||
@@ -242,7 +242,8 @@ void set_outputs(uint32_t functions_to_set_bitmask) {
|
||||
uint32_t temp_mask = 1;
|
||||
for (uint8_t i = 0; i < 32; i++) {
|
||||
if (temp_mask & functions_to_set_bitmask ){
|
||||
outputs_to_set |= get_32bit_CV(i * 8 + 260 - 4 * get_direction(0));
|
||||
bool dir = get_direction(0);
|
||||
outputs_to_set |= get_32bit_CV(i * 8 + 260 - 4 * dir);
|
||||
}
|
||||
temp_mask<<=1;
|
||||
}
|
||||
@@ -384,7 +385,7 @@ void instruction_evaluation(uint8_t number_of_bytes,const uint8_t * const byte_a
|
||||
update_active_functions((command_byte_n << 9),2,false);
|
||||
break;
|
||||
default: // F0-F4
|
||||
update_active_functions(((command_byte_n << 1) + (command_byte_n >> 4)),0,false);
|
||||
update_active_functions((((command_byte_n & 0b00001111) << 1) + ((command_byte_n & 0b00010000) >> 4)),0,false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -624,8 +625,13 @@ bool get_direction(bool *direction_ptr){
|
||||
static bool set_flag;
|
||||
static bool *dir_ptr;
|
||||
if(!set_flag) {
|
||||
dir_ptr = direction_ptr;
|
||||
set_flag = true;
|
||||
if (direction_ptr == NULL){
|
||||
LOG(0, "Error! Direction pointer argument is NULL-pointer!")
|
||||
}
|
||||
else {
|
||||
set_flag = true;
|
||||
dir_ptr = direction_ptr;
|
||||
}
|
||||
}
|
||||
return *dir_ptr;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user