Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit 1e09de3

Browse files
committed
Corrected issue with SW102 not working on previous version. Corrected issue on build script of SW102. Removed configuration for motor 36V and 48V experimental high cadence
1 parent 268350c commit 1e09de3

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

firmware/SW102/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,3 +353,8 @@ SDK_CONFIG_FILE := $(PROJ_DIR)/include/sdk_config.h
353353
CMSIS_CONFIG_TOOL := $(SDK_ROOT)/external_tools/cmsisconfig/CMSIS_Configuration_Wizard.jar
354354
sdk_config:
355355
java -jar $(CMSIS_CONFIG_TOOL) $(SDK_CONFIG_FILE)
356+
357+
clean_project: clean
358+
rm -rf $(OUTPUT_DIRECTORY)
359+
rm -rf $(RELEASE_DIRECTORY)
360+

firmware/SW102/src/sw102/uart.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const app_uart_comm_params_t comm_params =
3535
//Below values are defined in ser_config.h common for application and connectivity
3636
.flow_control = APP_UART_FLOW_CONTROL_DISABLED,
3737
.use_parity = false,
38-
.baud_rate = UART_BAUDRATE_BAUDRATE_Baud9600
38+
.baud_rate = UART_BAUDRATE_BAUDRATE_Baud19200
3939
};
4040

4141
uint8_t ui8_rx_buffer[UART_NUMBER_DATA_BYTES_TO_RECEIVE];
@@ -62,12 +62,6 @@ void usart1_reset_received_package(void)
6262
ui8_received_package_flag = 0;
6363
}
6464

65-
/**@brief Function for handling UART interrupts.
66-
*
67-
* @details This function will receive a single character from the UART and append it to a string.
68-
* The string will be be sent over BLE when the last character received was a 'new line'
69-
* i.e '\n' (hex 0x0D) or if the string has reached a length of @ref NUS_MAX_DATA_LENGTH.
70-
*/
7165
void uart_evt_callback(app_uart_evt_t * uart_evt)
7266
{
7367
uint8_t ui8_byte_received;
@@ -89,8 +83,11 @@ void uart_evt_callback(app_uart_evt_t * uart_evt)
8983
ui8_rx[0] = ui8_byte_received;
9084
ui8_state_machine = 1;
9185
}
92-
else
86+
else {
9387
ui8_state_machine = 0;
88+
}
89+
90+
ui8_rx_cnt = 0;
9491
break;
9592

9693
case 1:
@@ -105,7 +102,6 @@ void uart_evt_callback(app_uart_evt_t * uart_evt)
105102
// reset if it is the last byte of the package and index is out of bounds
106103
if (ui8_rx_cnt >= ui8_rx[1])
107104
{
108-
ui8_rx_cnt = 0;
109105
ui8_state_machine = 0;
110106

111107
// just to make easy next calculations

firmware/common/src/configscreen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static Field batterySOCMenus[] =
2828
FIELD_END };
2929

3030
static Field motorMenus[] = {
31-
FIELD_EDITABLE_ENUM(_S("Motor voltage", "Motor volt"), &ui_vars.ui8_motor_type, "48V", "36V", "exp 48V", "exp 36V"),
31+
FIELD_EDITABLE_ENUM(_S("Motor voltage", "Motor volt"), &ui_vars.ui8_motor_type, "48V", "36V"),
3232
FIELD_EDITABLE_UINT(_S("Max current", "Max curren"), &ui_vars.ui8_motor_max_current, "amps", 1, 30),
3333
FIELD_EDITABLE_UINT(_S("Current ramp", "Curre ramp"), &ui_vars.ui8_ramp_up_amps_per_second_x10, "amps", 4, 100, .div_digits = 1),
3434
FIELD_EDITABLE_UINT(_S("Min current ADC step", "Min ADC st"), &ui_vars.ui8_motor_current_min_adc, "amps", 0, 13), // 13 ADC steps = 2 amps

firmware/common/src/state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ void rt_send_tx_package(frame_type_t type) {
250250
(rt_vars.ui8_torque_sensor_calibration_feature_enabled << 3) |
251251
(rt_vars.ui8_torque_sensor_calibration_pedal_ground << 4) |
252252
(rt_vars.ui8_motor_assistance_startup_without_pedal_rotation << 5) |
253-
((rt_vars.ui8_motor_type & 0x3) << 6);
253+
((rt_vars.ui8_motor_type & 1) << 6);
254254

255255
// motor max current
256256
ui8_usart1_tx_buffer[9] = rt_vars.ui8_motor_max_current;

firmware/release-SW102_ota.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fi
1818
mkdir -p $RELEASE_FOLDER
1919

2020
cd SW102
21-
make -f Makefile clean
21+
make -f Makefile clean_project
2222
make -f Makefile generate_dfu_package VERSION=$VERSION
2323
cp _release/sw102-otaupdate-xxx.zip $RELEASE_FOLDER/sw102-otaupdate-$VERSION.zip
2424
cd ..

firmware/release-all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fi
1818
mkdir -p $RELEASE_FOLDER
1919

2020
cd SW102
21-
make -f Makefile clean
21+
make -f Makefile clean_project
2222
make -f Makefile generate_dfu_package VERSION=$VERSION
2323
cp _release/sw102-otaupdate-xxx.zip $RELEASE_FOLDER/sw102-otaupdate-$VERSION.zip
2424
cd ..

0 commit comments

Comments
 (0)