Skip to content

Commit 8c81c71

Browse files
platform/mikro-e/dev: restructure thermo3-click driver files and update its test app
Signed-off-by: Mayank Sirotiya <[email protected]>
1 parent 1c6e2a7 commit 8c81c71

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
CONTIKI_PROJECT = test-thermo3
2-
3-
ifndef TARGET
4-
TARGET=mikro-e
5-
endif
6-
72
CONTIKI = ../../../..
83

9-
APPS += dev
4+
CFLAGS += -DTHERMO3_CLICK
105

11-
APPDIRS += ../..
6+
APPS += thermo3-click
7+
APPDIRS += ../../dev
128

139
all: $(CONTIKI_PROJECT)
1410
xc32-bin2hex $(CONTIKI_PROJECT).$(TARGET)
1511

12+
distclean: cleanall
13+
14+
cleanall:
15+
rm -f symbols.*
16+
1617
include $(CONTIKI)/Makefile.include

platform/mikro-e/apps/test-thermo3/test-thermo3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
#include <contiki.h>
4141
#include <stdio.h>
42-
#include "thermo3-click.h"
42+
#include "dev/common-clicks.h"
4343

4444
#define TEMP_REG 0x00 /*Temp. register Address*/
4545
#define CONFIG_REG 0x01 /*Config. register Address*/
@@ -52,7 +52,7 @@ AUTOSTART_PROCESSES (&test_thermo3);
5252
PROCESS_THREAD(test_thermo3, ev, data)
5353
{
5454
PROCESS_BEGIN();
55-
static float temp_c;
55+
static double temp_c;
5656
static struct etimer et;
5757
tmp102_init();
5858
tmp102_reg_select(CONFIG_REG);

platform/mikro-e/dev/Makefile.dev

Lines changed: 0 additions & 2 deletions
This file was deleted.

platform/mikro-e/dev/common-clicks.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@
4040
#include "relay-click/relay-click.h"
4141
#endif
4242

43+
#ifdef THERMO3_CLICK
44+
#include "thermo3-click/thermo3-click.h"
45+
#endif
46+
4347
#endif /* __COMMON_CLICKS_H__ */
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
thermo3-click_src += thermo3-click.c
File renamed without changes.

platform/mikro-e/dev/thermo3-click.h renamed to platform/mikro-e/dev/thermo3-click/thermo3-click.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
*
3939
*/
4040

41-
#ifndef __TMP_102_H__
42-
#define __TMP_102_H__
41+
#ifndef __THERMO3_CLICK_H__
42+
#define __THERMO3_CLICK_H__
4343

4444
#define I2C_FREQUENCY 100000
4545

@@ -69,4 +69,4 @@ void tmp102_reg_read(uint8_t *);
6969
void tmp102_reg_write(uint8_t , uint8_t );
7070

7171
/*---------------------------------------------------------------------------*/
72-
#endif /* __TMP_102_H__ */
72+
#endif /* __THERMO3_CLICK_H__ */

0 commit comments

Comments
 (0)