diff --git a/Inc/project_config.h b/Inc/project_config.h index 9dba971..88cf7d3 100644 --- a/Inc/project_config.h +++ b/Inc/project_config.h @@ -2,7 +2,8 @@ #define _PROJECT_CONFIG_H_ // #define THERMAL_DATA_UART -#define TMP007_OVERLAY +// #define TMP007 +// #define TMP007_OVERLAY #define SPLASHSCREEN_OVERLAY // #define Y16 diff --git a/Inc/tmp007_i2c.h b/Inc/tmp007_i2c.h index 49135b2..bebb1aa 100644 --- a/Inc/tmp007_i2c.h +++ b/Inc/tmp007_i2c.h @@ -1,6 +1,7 @@ #ifndef TMP007_I2C_H_ #define TMP007_I2C_H_ +#if defined(TMP007) #define TMP007_VOBJ 0x00 #define TMP007_TDIE 0x01 #define TMP007_CONFIG 0x02 @@ -31,6 +32,7 @@ uint16_t tmp007_read_reg(unsigned int reg); long get_mili_celisius(void); int convert_C_to_F(int C); int read_tmp007_regs(void); +#endif #endif diff --git a/Src/lepton_task.c b/Src/lepton_task.c index bca7012..31c8486 100644 --- a/Src/lepton_task.c +++ b/Src/lepton_task.c @@ -252,7 +252,9 @@ PT_THREAD( lepton_task(struct pt *pt)) print_telemetry_temps(¤t_buffer->lines.rgb[TELEMETRY_OFFSET_LINES].data.telemetry_data); } +#if defined(TMP007) read_tmp007_regs(); +#endif last_tick = curtick; last_logged_count = current_frame_count; diff --git a/Src/main.c b/Src/main.c index 2e6217e..b064172 100644 --- a/Src/main.c +++ b/Src/main.c @@ -164,9 +164,11 @@ int main(void) init_lepton_command_interface(); +#if defined(TMP007) DEBUG_PRINTF("reading_tmp007_regs...\n\r"); read_tmp007_regs(); +#endif DEBUG_PRINTF("Initialized...\n\r"); diff --git a/Src/tmp007_i2c.c b/Src/tmp007_i2c.c index 4872856..2e342b8 100644 --- a/Src/tmp007_i2c.c +++ b/Src/tmp007_i2c.c @@ -14,6 +14,7 @@ #define DEBUG_PRINTF(...) #endif +#if defined(TMP007) extern I2C_HandleTypeDef hi2c1; int tmp007_init = 0; @@ -110,3 +111,4 @@ int read_tmp007_regs(void) return 1; } +#endif \ No newline at end of file diff --git a/Src/usb_task.c b/Src/usb_task.c index 6c01e98..c9538c8 100644 --- a/Src/usb_task.c +++ b/Src/usb_task.c @@ -40,7 +40,7 @@ void HAL_RCC_CSSCallback(void) { DEBUG_PRINTF("Oh no! HAL_RCC_CSSCallback()\r\n"); } -#ifdef TMP007_OVERLAY +#if defined(TMP007) && defined(TMP007_OVERLAY) #include "ugui.h" UG_GUI gui; static void pixel_set(UG_S16 x , UG_S16 y ,UG_COLOR c ) @@ -155,7 +155,7 @@ PT_THREAD( usb_task(struct pt *pt)) PT_BEGIN(pt); -#ifdef TMP007_OVERLAY +#if defined(TMP007) && defined(TMP007_OVERLAY) UG_Init(&gui,pixel_set,80,60); UG_FontSelect(&FONT_8X8); #endif @@ -192,7 +192,7 @@ PT_THREAD( usb_task(struct pt *pt)) else { -#ifdef TMP007_OVERLAY +#if defined(TMP007) && defined(TMP007_OVERLAY) if(overlay_mode == 1) { temperature = get_last_mili_celisius()/1000;