Skip to content

Commit

Permalink
Remove TMP007 operations by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kekiefer committed Oct 28, 2017
1 parent e282c96 commit ab57804
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Inc/project_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions Inc/tmp007_i2c.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

2 changes: 2 additions & 0 deletions Src/lepton_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ PT_THREAD( lepton_task(struct pt *pt))
print_telemetry_temps(&current_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;
Expand Down
2 changes: 2 additions & 0 deletions Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 2 additions & 0 deletions Src/tmp007_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define DEBUG_PRINTF(...)
#endif

#if defined(TMP007)
extern I2C_HandleTypeDef hi2c1;

int tmp007_init = 0;
Expand Down Expand Up @@ -110,3 +111,4 @@ int read_tmp007_regs(void)

return 1;
}
#endif
6 changes: 3 additions & 3 deletions Src/usb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ab57804

Please sign in to comment.