-
Notifications
You must be signed in to change notification settings - Fork 2
Protected Sensor Data Reads #95
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
Changes from all commits
0274bd5
eb65195
2b7bf3a
2add115
f40ef71
c66cc9f
9b630ad
cac9759
b5950aa
ba7e409
e6c57b4
ee24355
ce2760a
9a8cc80
4a4eb3e
6f144f9
062e934
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| This larger work, the Sun Devil Rocketry mod Submodule, uses the BSD-3-Clause. This software project does not use any dependencies, and all files in this project are covered under this license. | ||
| This larger work, the Sun Devil Rocketry mod Submodule, uses the BSD-3-Clause. This software project does not have any official dependencies, however some derivative code is used. This is attributed below. | ||
|
|
||
| sensor.c:sensor_conv_mag - Copyright (c) 2020 Bosch Sensortec GmbH. All rights reserved. BSD-3-Clause license. https://opensource.org/license/bsd-3-clause |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,7 @@ static BARO_CAL_DATA baro_cal_data; | |
| uint8_t baro_raw_buffer[6]; | ||
| float baro_pres_proc = NAN; | ||
| float baro_temp_proc = NAN; | ||
| bool baro_data_ready = false; | ||
| static bool baro_data_ready = false; | ||
|
|
||
|
|
||
| /*------------------------------------------------------------------------------ | ||
|
|
@@ -863,6 +863,25 @@ return write_reg( BARO_REG_CMD, BARO_CMD_FIFO_FLUSH ); | |
| } /* baro_flush_fifo */ | ||
|
|
||
|
|
||
| /******************************************************************************* | ||
| * * | ||
| * PROCEDURE: * | ||
| * baro_get_baro_data_ready * | ||
| * * | ||
| * DESCRIPTION: * | ||
| * Returns the baro_data_ready flag * | ||
| * * | ||
| *******************************************************************************/ | ||
| bool baro_get_baro_data_ready | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixing this myself bc it's a total nitpick but whitespace is still a little off. it should be two lines between functions |
||
| ( | ||
| void | ||
| ) | ||
| { | ||
| return baro_data_ready; | ||
|
|
||
| } /* baro_get_baro_data_ready */ | ||
|
|
||
|
|
||
| /******************************************************************************* | ||
| * * | ||
| * PROCEDURE: * | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,10 +52,10 @@ | |
| #if defined( A0002_REV2 ) | ||
| uint8_t imu_raw_buffer[12]; | ||
| IMU_RAW imu_raw_processed; | ||
| bool imu_data_ready; | ||
| static bool imu_data_ready; | ||
|
|
||
| uint8_t mag_raw_buffer[8]; | ||
| bool mag_data_ready; | ||
| static bool mag_data_ready; | ||
| #endif | ||
|
|
||
| MAG_TRIM mag_trim; | ||
|
|
@@ -871,6 +871,44 @@ else | |
| } /* read_imu_regs */ | ||
|
|
||
|
|
||
| /******************************************************************************* | ||
| * * | ||
| * PROCEDURE: * | ||
| * imu_get_imu_data_ready * | ||
| * * | ||
| * DESCRIPTION: * | ||
| * Returns the imu_data_ready flag * | ||
| * * | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Only one line of spacing at the bottom of a procedure header |
||
| *******************************************************************************/ | ||
| bool imu_get_imu_data_ready | ||
| ( | ||
| void | ||
| ) | ||
| { | ||
| return imu_data_ready; | ||
|
|
||
| } /* imu_get_imu_data_ready */ | ||
|
|
||
|
|
||
| /******************************************************************************* | ||
| * * | ||
| * PROCEDURE: * | ||
| * imu_get_mag_data_ready * | ||
| * * | ||
| * DESCRIPTION: * | ||
| * Returns the mag_data_ready flag * | ||
| * * | ||
| *******************************************************************************/ | ||
| bool imu_get_mag_data_ready | ||
| ( | ||
| void | ||
| ) | ||
| { | ||
| return mag_data_ready; | ||
|
|
||
| } /* imu_get_mag_data_ready */ | ||
|
|
||
|
|
||
| #if defined( A0002_REV2 ) | ||
| /******************************************************************************* | ||
| * * | ||
|
|
||
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.
You appear to be double indenting (8 spaces instead of 4) when you hit tab. This is likely a setting in vim that can be updated.
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.
Also if you have a "tabs -> spaces" setting, I recommend enabling that as well. Tabs can be variable between different text editors, but if it converts to spaces then it'll render correctly across them.