diff --git a/applications/app_adc.c b/applications/app_adc.c index c98777f83..a1f24a9df 100644 --- a/applications/app_adc.c +++ b/applications/app_adc.c @@ -38,7 +38,7 @@ // Threads static THD_FUNCTION(adc_thread, arg); -static THD_WORKING_AREA(adc_thread_wa, 1024); +static THD_WORKING_AREA(adc_thread_wa, 512); // Private variables static volatile adc_config config; diff --git a/applications/app_balance.c b/applications/app_balance.c index 66f69aade..c4bc94120 100644 --- a/applications/app_balance.c +++ b/applications/app_balance.c @@ -80,7 +80,7 @@ typedef enum { // Balance thread static THD_FUNCTION(balance_thread, arg); -static THD_WORKING_AREA(balance_thread_wa, 2048); // 2kb stack for this thread +static THD_WORKING_AREA(balance_thread_wa, 1024); // 2kb stack for this thread static thread_t *app_thread; diff --git a/applications/app_custom_template.c b/applications/app_custom_template.c index 09f9766fd..87898bbf3 100644 --- a/applications/app_custom_template.c +++ b/applications/app_custom_template.c @@ -37,7 +37,7 @@ // Threads static THD_FUNCTION(my_thread, arg); -static THD_WORKING_AREA(my_thread_wa, 2048); +static THD_WORKING_AREA(my_thread_wa, 1024); // Private functions static void pwm_callback(void); diff --git a/applications/app_nunchuk.c b/applications/app_nunchuk.c index 71c0f9ec8..15a0e6950 100644 --- a/applications/app_nunchuk.c +++ b/applications/app_nunchuk.c @@ -39,9 +39,9 @@ // Threads static THD_FUNCTION(chuk_thread, arg); -static THD_WORKING_AREA(chuk_thread_wa, 1024); +static THD_WORKING_AREA(chuk_thread_wa, 512); static THD_FUNCTION(output_thread, arg); -static THD_WORKING_AREA(output_thread_wa, 1024); +static THD_WORKING_AREA(output_thread_wa, 512); // Private variables static volatile bool stop_now = true; diff --git a/applications/app_pas.c b/applications/app_pas.c index aac02a5aa..8e509ae5b 100644 --- a/applications/app_pas.c +++ b/applications/app_pas.c @@ -39,7 +39,7 @@ // Threads static THD_FUNCTION(pas_thread, arg); -static THD_WORKING_AREA(pas_thread_wa, 1024); +static THD_WORKING_AREA(pas_thread_wa, 512); // Private variables static volatile pas_config config; diff --git a/applications/app_ppm.c b/applications/app_ppm.c index a86c64f1a..054e2422e 100644 --- a/applications/app_ppm.c +++ b/applications/app_ppm.c @@ -35,7 +35,7 @@ // Threads static THD_FUNCTION(ppm_thread, arg); -static THD_WORKING_AREA(ppm_thread_wa, 1536); +static THD_WORKING_AREA(ppm_thread_wa, 512); static thread_t *ppm_tp; static volatile bool ppm_rx = false; diff --git a/applications/app_uartcomm.c b/applications/app_uartcomm.c index aca68ed22..3818e9666 100644 --- a/applications/app_uartcomm.c +++ b/applications/app_uartcomm.c @@ -42,7 +42,7 @@ // Threads static THD_FUNCTION(packet_process_thread, arg); -static THD_WORKING_AREA(packet_process_thread_wa, 4096); +static THD_WORKING_AREA(packet_process_thread_wa, 2048); // Variables static volatile bool thread_is_running = false; diff --git a/comm_can.c b/comm_can.c index a55e9cc89..c5452115f 100644 --- a/comm_can.c +++ b/comm_can.c @@ -45,8 +45,8 @@ #if CAN_ENABLE // Threads -static THD_WORKING_AREA(cancom_read_thread_wa, 512); -static THD_WORKING_AREA(cancom_process_thread_wa, 4096); +static THD_WORKING_AREA(cancom_read_thread_wa, 256); +static THD_WORKING_AREA(cancom_process_thread_wa, 2048); static THD_WORKING_AREA(cancom_status_thread_wa, 512); static THD_FUNCTION(cancom_read_thread, arg); static THD_FUNCTION(cancom_status_thread, arg); diff --git a/comm_usb.c b/comm_usb.c index 65e07ee8f..5684ad654 100644 --- a/comm_usb.c +++ b/comm_usb.c @@ -30,7 +30,7 @@ static uint8_t serial_rx_buffer[SERIAL_RX_BUFFER_SIZE]; static int serial_rx_read_pos = 0; static int serial_rx_write_pos = 0; static THD_WORKING_AREA(serial_read_thread_wa, 256); -static THD_WORKING_AREA(serial_process_thread_wa, 4096); +static THD_WORKING_AREA(serial_process_thread_wa, 2048); static mutex_t send_mutex; static thread_t *process_tp; static volatile unsigned int write_timeout_cnt = 0; diff --git a/conf_general.h b/conf_general.h index d2292d9aa..507934fed 100755 --- a/conf_general.h +++ b/conf_general.h @@ -21,10 +21,10 @@ #define CONF_GENERAL_H_ // Firmware version -#define FW_VERSION_MAJOR 5 -#define FW_VERSION_MINOR 03 +#define FW_VERSION_MAJOR 6 +#define FW_VERSION_MINOR 00 // Set to 0 for building a release and iterate during beta test builds -#define FW_TEST_VERSION_NUMBER 0 +#define FW_TEST_VERSION_NUMBER 1 #include "datatypes.h" diff --git a/gpdrive.c b/gpdrive.c index f99719e44..481be0484 100644 --- a/gpdrive.c +++ b/gpdrive.c @@ -81,7 +81,7 @@ static void set_modulation(float mod); static void do_dc_cal(void); // Threads -static THD_WORKING_AREA(timer_thread_wa, 2048); +static THD_WORKING_AREA(timer_thread_wa, 512); static THD_FUNCTION(timer_thread, arg); static volatile bool timer_thd_stop; diff --git a/hwconf/hw_45.c b/hwconf/hw_45.c index 17f4a7243..79ca8b850 100644 --- a/hwconf/hw_45.c +++ b/hwconf/hw_45.c @@ -31,7 +31,7 @@ // Threads THD_FUNCTION(temp_thread, arg); -static THD_WORKING_AREA(temp_thread_wa, 512); +static THD_WORKING_AREA(temp_thread_wa, 256); static bool temp_thread_running = false; // Variables diff --git a/hwconf/hw_gesc.c b/hwconf/hw_gesc.c index 308460169..86fe7430f 100644 --- a/hwconf/hw_gesc.c +++ b/hwconf/hw_gesc.c @@ -38,7 +38,7 @@ // Threads THD_FUNCTION(mag_thread, arg); -static THD_WORKING_AREA(mag_thread_wa, 512); +static THD_WORKING_AREA(mag_thread_wa, 256); static bool mag_thread_running = false; // Variables diff --git a/hwconf/hw_stormcore_100d.c b/hwconf/hw_stormcore_100d.c index 4e09b4b2f..4303a833c 100644 --- a/hwconf/hw_stormcore_100d.c +++ b/hwconf/hw_stormcore_100d.c @@ -39,7 +39,7 @@ typedef enum { // Variables static volatile bool i2c_running = false; static THD_WORKING_AREA(smart_switch_thread_wa, 128); -static THD_WORKING_AREA(mux_thread_wa, 256); +static THD_WORKING_AREA(mux_thread_wa, 128); static THD_WORKING_AREA(switch_color_thread_wa, 128); static THD_FUNCTION(mux_thread, arg); static THD_FUNCTION(switch_color_thread, arg); diff --git a/hwconf/hw_stormcore_60d.c b/hwconf/hw_stormcore_60d.c index 276757ec1..e45cbd689 100644 --- a/hwconf/hw_stormcore_60d.c +++ b/hwconf/hw_stormcore_60d.c @@ -36,7 +36,7 @@ typedef enum { // Variables static volatile bool i2c_running = false; static THD_WORKING_AREA(smart_switch_thread_wa, 128); -static THD_WORKING_AREA(mux_thread_wa, 256); +static THD_WORKING_AREA(mux_thread_wa, 128); static THD_WORKING_AREA(switch_color_thread_wa, 128); static THD_FUNCTION(mux_thread, arg); static THD_FUNCTION(switch_color_thread, arg); diff --git a/hwconf/hw_uavc_qcube.c b/hwconf/hw_uavc_qcube.c index f2d5e140b..74cd7c297 100644 --- a/hwconf/hw_uavc_qcube.c +++ b/hwconf/hw_uavc_qcube.c @@ -25,7 +25,7 @@ // Threads THD_FUNCTION(dac_thread, arg); -static THD_WORKING_AREA(dac_thread_wa, 512); +static THD_WORKING_AREA(dac_thread_wa, 128); static bool dac_thread_running = false; // Variables diff --git a/hwconf/hw_unity.c b/hwconf/hw_unity.c index a43433d7c..241b6ccb5 100644 --- a/hwconf/hw_unity.c +++ b/hwconf/hw_unity.c @@ -36,7 +36,7 @@ typedef enum { // Variables static volatile bool i2c_running = false; static THD_WORKING_AREA(smart_switch_thread_wa, 128); -static THD_WORKING_AREA(mux_thread_wa, 256); +static THD_WORKING_AREA(mux_thread_wa, 128); static THD_FUNCTION(mux_thread, arg); static volatile switch_states switch_state = SWITCH_BOOTED; diff --git a/hwconf/hw_uxv_sr.c b/hwconf/hw_uxv_sr.c index 7931ce472..5cc447ae3 100644 --- a/hwconf/hw_uxv_sr.c +++ b/hwconf/hw_uxv_sr.c @@ -28,7 +28,7 @@ // Threads THD_FUNCTION(dac_thread, arg); -static THD_WORKING_AREA(dac_thread_wa, 1024); +static THD_WORKING_AREA(dac_thread_wa, 256); static bool dac_thread_running = false; // Variables @@ -285,4 +285,4 @@ THD_FUNCTION(dac_thread, arg) { DAC->DHR12R2 = scaled_current; chThdSleepMilliseconds(100); } -} \ No newline at end of file +} diff --git a/hwconf/si8900.c b/hwconf/si8900.c index cecb42533..1a23a4c58 100644 --- a/hwconf/si8900.c +++ b/hwconf/si8900.c @@ -26,7 +26,7 @@ // Private variables static THD_FUNCTION(si_read_thread, arg); -static THD_WORKING_AREA(si_read_thread_wa, 512); +static THD_WORKING_AREA(si_read_thread_wa, 256); static volatile float m_voltages[3]; // Private functions diff --git a/imu/imu.c b/imu/imu.c index 422864311..0ddab99be 100644 --- a/imu/imu.c +++ b/imu/imu.c @@ -37,7 +37,7 @@ static ATTITUDE_INFO m_att; static FusionAhrs m_fusionAhrs; static float m_accel[3], m_gyro[3], m_mag[3]; -static stkalign_t m_thd_work_area[THD_WORKING_AREA_SIZE(2048) / sizeof(stkalign_t)]; +static stkalign_t m_thd_work_area[THD_WORKING_AREA_SIZE(1024) / sizeof(stkalign_t)]; static i2c_bb_state m_i2c_bb; static spi_bb_state m_spi_bb; static ICM20948_STATE m_icm20948_state; diff --git a/libcanard/canard_driver.c b/libcanard/canard_driver.c index e04c6f5f1..420f5aa1b 100755 --- a/libcanard/canard_driver.c +++ b/libcanard/canard_driver.c @@ -84,7 +84,7 @@ static uint8_t my_node_id = 0; static bool refresh_parameters_enabled = true; // Threads -static THD_WORKING_AREA(canard_thread_wa, 2048); +static THD_WORKING_AREA(canard_thread_wa, 1024); static THD_FUNCTION(canard_thread, arg); // Private functions diff --git a/lora/lora.c b/lora/lora.c index 986343554..217407e98 100644 --- a/lora/lora.c +++ b/lora/lora.c @@ -37,7 +37,7 @@ // Threads static THD_FUNCTION(packet_process_thread, arg); -static THD_WORKING_AREA(packet_process_thread_wa, 4096); +static THD_WORKING_AREA(packet_process_thread_wa, 2048); // Variables static volatile bool thread_is_running = false; diff --git a/main.c b/main.c index 2598f1475..8cf330ede 100644 --- a/main.c +++ b/main.c @@ -80,7 +80,7 @@ */ // Private variables -static THD_WORKING_AREA(periodic_thread_wa, 512); +static THD_WORKING_AREA(periodic_thread_wa, 256); static THD_WORKING_AREA(led_thread_wa, 256); static THD_WORKING_AREA(flash_integrity_check_thread_wa, 256); static bool m_init_done = false; diff --git a/mc_interface.c b/mc_interface.c index 46bf513f9..dd4b5aa1a 100644 --- a/mc_interface.c +++ b/mc_interface.c @@ -132,7 +132,7 @@ static volatile motor_if_state_t *motor_now(void); static void(*pwn_done_func)(void) = 0; // Threads -static THD_WORKING_AREA(timer_thread_wa, 1024); +static THD_WORKING_AREA(timer_thread_wa, 512); static THD_FUNCTION(timer_thread, arg); static THD_WORKING_AREA(sample_send_thread_wa, 512); static THD_FUNCTION(sample_send_thread, arg); diff --git a/mcpwm.c b/mcpwm.c index 1014aca1d..69efbb265 100644 --- a/mcpwm.c +++ b/mcpwm.c @@ -160,9 +160,9 @@ static void pll_run(float phase, float dt, volatile float *phase_var, #define IS_DETECTING() (state == MC_STATE_DETECTING) // Threads -static THD_WORKING_AREA(timer_thread_wa, 2048); +static THD_WORKING_AREA(timer_thread_wa, 512); static THD_FUNCTION(timer_thread, arg); -static THD_WORKING_AREA(rpm_thread_wa, 1024); +static THD_WORKING_AREA(rpm_thread_wa, 512); static THD_FUNCTION(rpm_thread, arg); static volatile bool timer_thd_stop; static volatile bool rpm_thd_stop; diff --git a/mcpwm_foc.c b/mcpwm_foc.c index e78349303..7db1de4eb 100644 --- a/mcpwm_foc.c +++ b/mcpwm_foc.c @@ -226,15 +226,15 @@ static void input_current_offset_measurement( void ); static void hfi_update(volatile motor_all_state_t *motor); // Threads -static THD_WORKING_AREA(timer_thread_wa, 1024); +static THD_WORKING_AREA(timer_thread_wa, 512); static THD_FUNCTION(timer_thread, arg); static volatile bool timer_thd_stop; -static THD_WORKING_AREA(hfi_thread_wa, 1024); +static THD_WORKING_AREA(hfi_thread_wa, 512); static THD_FUNCTION(hfi_thread, arg); static volatile bool hfi_thd_stop; -static THD_WORKING_AREA(pid_thread_wa, 512); +static THD_WORKING_AREA(pid_thread_wa, 256); static THD_FUNCTION(pid_thread, arg); static volatile bool pid_thd_stop; diff --git a/nrf/nrf_driver.c b/nrf/nrf_driver.c index 57d129c85..96cb63b66 100644 --- a/nrf/nrf_driver.c +++ b/nrf/nrf_driver.c @@ -39,7 +39,7 @@ // Variables static THD_WORKING_AREA(rx_thread_wa, 2048); -static THD_WORKING_AREA(tx_thread_wa, 512); +static THD_WORKING_AREA(tx_thread_wa, 256); static mote_state mstate; static uint8_t rx_buffer[RX_BUFFER_SIZE]; static int nosend_cnt; diff --git a/timeout.c b/timeout.c index 8ee9f6a27..bf5268209 100644 --- a/timeout.c +++ b/timeout.c @@ -33,7 +33,7 @@ static volatile bool kill_sw_active; static volatile uint32_t feed_counter[MAX_THREADS_MONITOR]; // Threads -static THD_WORKING_AREA(timeout_thread_wa, 512); +static THD_WORKING_AREA(timeout_thread_wa, 256); static THD_FUNCTION(timeout_thread, arg); void timeout_init(void) {