Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add analogoutput and simulated ABS effect #9

Merged
merged 16 commits into from
Dec 24, 2023
Merged

Conversation

tcfshcrw
Copy link
Collaborator

add analog output for SC D15 port
add simulated ABS effect, so modified the dap_config structure.

and analog output and  simulated ABS trigger 
current simulated abs trigger was set to 80%, will add a slider to simhub to control
add check box for simulated ABS trigger
also add trigger to DAP config
Reading config when connect to pedal
add comment to #define using_analog_output
default was BLE connection
add trigger value for simulated ABS
add slider for trigger of simulated ABS
add arduino code instruction
add arduino code instruction
@@ -685,7 +685,7 @@ void pedalUpdateTask( void * pvParameters )
}
if(dap_config_st.payLoadPedalConfig_.Simulate_ABS_trigger==1)
{
if(joystickNormalizedToInt32>8000)
if(joystickNormalizedToInt32>dap_config_st.payLoadPedalConfig_.Simulate_ABS_value*100)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An uint8 value is multiplied by 100. Thats potentially dangerous as it could lead to overflow. Could you please add an int32 cast here, e.g.:

((int32)dap_config_st.payLoadPedalConfig_.Simulate_ABS_value) * 100

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An uint8 value is multiplied by 100. Thats potentially dangerous as it could lead to overflow. Could you please add an int32 cast here, e.g.:

((int32)dap_config_st.payLoadPedalConfig_.Simulate_ABS_value) * 100

done and also upload the canvas control plugin
image

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Since a field to the config structure was added, please increment the revision DAP_VERSION_CONFIG to 109 in the arduino and plugin code

Arduino code:

Plugin code:

dap_config_initial_st.payloadHeader_.version = 108;

public uint pedalConfigPayload_version = 108;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all done! many thanks!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the more interactive canvas control, the vertical sliders can be removed and the rectangle positions have to be updated when the config is received from the pedal:
image

You would do me a favour by implementing the aforementioned changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the more interactive canvas control, the vertical sliders can be removed and the rectangle positions have to be updated when the config is received from the pedal: image

You would do me a favour by implementing the aforementioned changes.

I think the config from pedal will auto update.
will hide those slide first, when I have time, will clean the code then.
canvas_control_reading_from_config

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the force vs travel slider code clean up already done

ABS trigger value change type to int32
control by canvas
add rectangles on canvas to control AP travel vs force
fix a graphic issue
when data was <5 or>95, the value will incorrect
config version bump to 109
config version bump tp 109.
graphic issue fix
hidden force_travel control slider
Slider code cleanup
also bug fixed.
@ChrGri ChrGri merged commit 55892cc into ChrGri:main Dec 24, 2023
1 check failed
ChrGri added a commit that referenced this pull request Jul 12, 2024
ChrGri added a commit that referenced this pull request Jul 12, 2024
ChrGri added a commit that referenced this pull request Jul 12, 2024
ChrGri added a commit that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants