Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion NOTICE
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
21 changes: 20 additions & 1 deletion baro/baro.c

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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.

Original file line number Diff line number Diff line change
Expand Up @@ -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;


/*------------------------------------------------------------------------------
Expand Down Expand Up @@ -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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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: *
Expand Down
6 changes: 6 additions & 0 deletions baro/baro.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,12 @@ BARO_STATUS baro_get_altitude
void
);

/* returns the baro_data_ready flag */
bool baro_get_baro_data_ready
(
void
);

BARO_STATUS start_baro_read_IT();
BARO_STATUS baro_IT_handler();
BARO_STATUS get_baro_it(float* pres_ptr, float* temp_ptr);
Expand Down
38 changes: 37 additions & 1 deletion common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,41 @@
API Functions
------------------------------------------------------------------------------*/

/*******************************************************************************
* *
* PROCEDURE: *
* disable_irq *
* *
* DESCRIPTION: *
* Disables IRQ interrupts; wrapper for __disable_irq() *
* *
*******************************************************************************/
void disable_irq
(
void
)
{
__disable_irq();
} /* disable_irq */


/*******************************************************************************
* *
* PROCEDURE: *
* enable_irq *
* *
* DESCRIPTION: *
* Enables IRQ interrupts; wrapper for __enable_irq() *
* *
*******************************************************************************/
void enable_irq
(
void
)
{
__enable_irq();
} /* enable_irq */


/*******************************************************************************
* *
Expand All @@ -66,6 +101,7 @@ HAL_Delay(delay);

} /* delay_ms */


/*******************************************************************************
* END OF FILE *
*******************************************************************************/
*******************************************************************************/
14 changes: 11 additions & 3 deletions common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C" {


/*------------------------------------------------------------------------------
Typdefs
Typedefs
------------------------------------------------------------------------------*/

/* UID serial number (packed struct inhibits padding) */
Expand Down Expand Up @@ -107,7 +107,15 @@ memcpy( uid_buffer, uid, sizeof( ST_UID_TYPE ) );
Function Prototypes
------------------------------------------------------------------------------*/

/* common */
void disable_irq
(
void
);

void enable_irq
(
void
);

void delay_ms
(
Expand All @@ -121,4 +129,4 @@ void delay_ms

/*******************************************************************************
* END OF FILE *
*******************************************************************************/
*******************************************************************************/
42 changes: 40 additions & 2 deletions imu/imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -871,6 +871,44 @@ else
} /* read_imu_regs */


/*******************************************************************************
* *
* PROCEDURE: *
* imu_get_imu_data_ready *
* *
* DESCRIPTION: *
* Returns the imu_data_ready flag *
* *

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 )
/*******************************************************************************
* *
Expand Down
12 changes: 12 additions & 0 deletions imu/imu.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,18 @@ void IMU_config
uint16_t mag_setting
);

/* Get the static variable imu_data_ready */
bool imu_get_imu_data_ready
(
void
);

/* Get the static variable mag_data_ready */
bool imu_get_mag_data_ready
(
void
);

#ifdef A0002_REV2
IMU_STATUS start_imu_read_IT(void);
IMU_STATUS imu_it_handler();
Expand Down
Loading