Skip to content

Commit

Permalink
all ECUs can use big blocking factor! (#474)
Browse files Browse the repository at this point in the history
* all ECUs can use big blocking factor!

* reclaim 100 bytes of blocking factor

* fits on ethernet f4

* ch-ch-ch-ch-changelog

* bump it a little
  • Loading branch information
mck1117 authored Aug 31, 2024
1 parent 97f2619 commit 5c614ca
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions firmware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ or
- Fix decel fuel cutoff (DFCO) on engines without a MAP sensor #457
- Automatic calculation of knock sense frequency based on cylinder bore #379
- Removed MAP sampling option that can result in inaccurate MAP sensor readings
- Improve TunerStudio performance on STM32F4-based ECUs #474

## December 2023 Release

Expand Down
2 changes: 0 additions & 2 deletions firmware/config/boards/atlas/prepend.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@
! Atlas is guaranteed dual bank flash, so there's no delay when sending the burn command.
! All commands should complete effectively instantly.
#define TS_BLOCK_READ_TIMEOUT 250

#define BLOCKING_FACTOR 1500
1 change: 0 additions & 1 deletion firmware/config/boards/nucleo_f767/prepend.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
#define BLOCKING_FACTOR 1500
1 change: 0 additions & 1 deletion firmware/config/boards/proteus/prepend.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@
#define show_Proteus_presets true

#define LUA_SCRIPT_SIZE 12000
#define BLOCKING_FACTOR 1500
2 changes: 1 addition & 1 deletion firmware/config/stm32f4ems/efifeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@

#if MODULE_ETHERNET_CONSOLE
// F4 ethernet needs some extra space
#define LUA_USER_HEAP 40000
#define LUA_USER_HEAP 25000
#else // MODULE_ETHERNET_CONSOLE
#define LUA_USER_HEAP 50000
#endif
Expand Down
2 changes: 0 additions & 2 deletions firmware/console/binary/output_channels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,4 @@ float mapFast
uint16_t mapAveragingSamples

uint8_t[12 iterate] mapPerCylinder;;"kPa", 1, 0, 0, 0, 0

uint8_t[102 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
end_struct
9 changes: 5 additions & 4 deletions firmware/console/binary/tunerstudio_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,18 @@ static Timer requestPeriodTimer;
* Gauges refresh
*/
void TunerStudio::cmdOutputChannels(TsChannelBase* tsChannel, uint16_t offset, uint16_t count) {
// Assert that the entire output channels block will fit in a single TS transaction
static_assert(BLOCKING_FACTOR >= TS_TOTAL_OUTPUT_SIZE + 10);

if (offset + count > TS_TOTAL_OUTPUT_SIZE) {
efiPrintf("TS: Version Mismatch? Too much outputs requested %d/%d/%d", offset, count,
sizeof(TunerStudioOutputChannels));
sendErrorCode(tsChannel, TS_RESPONSE_OUT_OF_RANGE);
return;
}

if (offset < BLOCKING_FACTOR) {
engine->outputChannels.outputRequestPeriod
= 1e6 * requestPeriodTimer.getElapsedSecondsAndReset(getTimeNowNt());
}
engine->outputChannels.outputRequestPeriod
= 1e6 * requestPeriodTimer.getElapsedSecondsAndReset(getTimeNowNt());

tsState.outputChannelsCommandCounter++;
updateTunerStudioState();
Expand Down
1 change: 0 additions & 1 deletion firmware/console/usb_console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include "thread_controller.h"
#include "tunerstudio.h"


// Assert that the USB tx/rx buffers are large enough to fit one full packet
static_assert(SERIAL_USB_BUFFERS_SIZE >= BLOCKING_FACTOR + 10);

Expand Down
2 changes: 1 addition & 1 deletion firmware/integration/rusefi_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct_no_prefix persistent_config_s

struct_no_prefix engine_configuration_s

#define BLOCKING_FACTOR 750
#define BLOCKING_FACTOR 1320

#define SENT_INPUT_COUNT 1

Expand Down

0 comments on commit 5c614ca

Please sign in to comment.