-
Notifications
You must be signed in to change notification settings - Fork 0
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
gps: use GPIO interrupt to track pulse per second (PPS) into a counter variable #239
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Needs to be rebased before it can be reviewed
I wasn't sure where to put the files so I created a new folder for gps and telecommand GPS.
Will not enable if GPS is not powered on, and if it is turned off and interrupt is called to turn off interrupt.
* Implement `TCMDEXEC_comms_dipole_switch_set_state` (#229) * Fix link to cts1_ground_support to go to new repo (#237) * IOC TESTING - Convert PIN_GPS_PPS_IN to EXTI mode --------- Co-authored-by: DeflateAwning <[email protected]> Co-authored-by: Muhammad Ali <[email protected]>
…t through interrupt Added additional functions to ensure variable are private and can't be changed through other functions.
4459aa6
to
7f699ea
Compare
Please name your pull request in a way that clearly and exclusively describes the change(s). Do not include "Alex on/122..." from the branch name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Just a few fixes though.
response_output_buf, response_output_buf_len, | ||
"PPS tracking enabled"); | ||
return 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix indentation. Use 4 spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should already be 4 spaces if I'm not wrong. for all of those lines.
Moved EXTI handler location
Co-authored-by: NuclearTea <[email protected]>
* Enabled EXTI lines [9:5] using CubeMX * Changes to make EXTI work --------- Co-authored-by: NuclearTea <[email protected]>
0000000000000+0000468360_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 121 FrontierSat time: 19700101T00:07:48.933, Uptime: 468934 ms FrontierSat time: 19700101T00:07:49.928, Uptime: 469929 ms 0000000000000+0000470653_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 122 FrontierSat time: 19700101T00:07:50.923, Uptime: 470924 ms 0000000000000+0000471796_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 123 OBC->EPS DATA (no tags): 1A 07 06 00 OBC->EPS DATA (with tags): 3C 63 6D 64 3E 1A 07 06 00 3C 2F 63 6D 64 3E EPS->OBC ERROR: timeout before first byte received 0000000000000+0000471897_N [EPS:ERROR]: EPS_CMD_watchdog() -> Error: 3 FrontierSat time: 19700101T00:07:51.918, Uptime: 471919 ms 0000000000000+0000472697_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 124 FrontierSat time: 19700101T00:07:52.914, Uptime: 472915 ms 0000000000000+0000473041_N [EPS:NORMAL]: Setting OBC time based on EPS time because last_source == TIM_SOURCE_NONE OBC->EPS DATA (no tags): 1A 07 40 00 OBC->EPS DATA (with tags): 3C 63 6D 64 3E 1A 07 40 00 3C 2F 63 6D 64 3E EPS->OBC ERROR: timeout before first byte received 0000000000000+0000473120_N [EPS:ERROR]: EPS_set_obc_time_based_on_eps_time() -> Error 0000000000000+0000473567_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 125 FrontierSat time: 19700101T00:07:53.909, Uptime: 473910 ms 0000000000000+0000474424_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 126 FrontierSat time: 19700101T00:07:54.904, Uptime: 474905 ms 0000000000000+0000475244_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 127 FrontierSat time: 19700101T00:07:55.899, Uptime: 475900 ms 0000000000000+0000476728_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 128 FrontierSat time: 19700101T00:07:56.894, Uptime: 476895 ms 0000000000000+0000477571_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 129 FrontierSat time: 19700101T00:07:57.889, Uptime: 477890 ms 0000000000000+0000478127_N [EPS:NORMAL]: Setting OBC time based on EPS time because last_source == TIM_SOURCE_NONE OBC->EPS DATA (no tags): 1A 07 40 00 OBC->EPS DATA (with tags): 3C 63 6D 64 3E 1A 07 40 00 3C 2F 63 6D 64 3E EPS->OBC ERROR: timeout before first byte received 0000000000000+0000478206_N [EPS:ERROR]: EPS_set_obc_time_based_on_eps_time() -> Error FrontierSat time: 19700101T00:07:58.884, Uptime: 478885 ms 0000000000000+0000479015_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 130 FrontierSat time: 19700101T00:07:59.879, Uptime: 479880 ms FrontierSat time: 19700101T00:08:00.874, Uptime: 480875 ms 0000000000000+0000481356_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 132 FrontierSat time: 19700101T00:08:01.869, Uptime: 481870 ms 0000000000000+0000482166_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 133 FrontierSat time: 19700101T00:08:02.864, Uptime: 482865 ms 0000000000000+0000483015_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 134 0000000000000+0000483213_N [EPS:NORMAL]: Setting OBC time based on EPS time because last_source == TIM_SOURCE_NONE OBC->EPS DATA (no tags): 1A 07 40 00 OBC->EPS DATA (with tags): 3C 63 6D 64 3E 1A 07 40 00 3C 2F 63 6D 64 3E EPS->OBC ERROR: timeout before first byte received 0000000000000+0000483292_N [EPS:ERROR]: EPS_set_obc_time_based_on_eps_time() -> Error FrontierSat time: 19700101T00:08:03.859, Uptime: 483860 ms 0000000000000+0000484345_N [TELECOMMAND:NORMAL]: GPS PPS interrupt. Counter: 135 Works as long as it is pulsed.
Current Code works to count up when quickly pressed. |
It should check to see if PIN A6(GPS_PPS_PIN) changes using a external interrupt to increase a counter. Please double check my logic. Thx