Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/9964


Change subject: make adc2uv common
......................................................................

make adc2uv common

when building the trace app for the simtrace board gcc was outputing
the following error:
libboard/common/source/boardver_adc.c:20:17: warning: 'adc2uv' defined but not 
used [-Wunused-function]
 static uint32_t adc2uv(uint16_t adc)

adc2uv is used by qmod, and defined in two places:
in boardver_adc.c and mode_cardemu.c.

this change will have adc2uv only defined in boardver_adc.c and make
available in the header to be used by mode_cardemu.c.

Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55
---
M firmware/libboard/common/include/boardver_adc.h
M firmware/libboard/common/source/boardver_adc.c
M firmware/libcommon/source/mode_cardemu.c
3 files changed, 3 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/64/9964/1

diff --git a/firmware/libboard/common/include/boardver_adc.h 
b/firmware/libboard/common/include/boardver_adc.h
index 9b01d0a..956c302 100644
--- a/firmware/libboard/common/include/boardver_adc.h
+++ b/firmware/libboard/common/include/boardver_adc.h
@@ -15,3 +15,4 @@
 #pragma once

 int get_board_version_adc(void);
+uint32_t adc2uv(uint16_t adc);
diff --git a/firmware/libboard/common/source/boardver_adc.c 
b/firmware/libboard/common/source/boardver_adc.c
index f204aa1..51db929 100644
--- a/firmware/libboard/common/source/boardver_adc.c
+++ b/firmware/libboard/common/source/boardver_adc.c
@@ -15,9 +15,8 @@
 #include "board.h"
 #include "boardver_adc.h"

-/* FIXME: share this with mode_cardemu.c */
 #define UV_PER_LSB     ((3300 * 1000) / 4096)
-static uint32_t adc2uv(uint16_t adc)
+uint32_t adc2uv(uint16_t adc)
 {
        uint32_t uv = (uint32_t) adc * UV_PER_LSB;
        return uv;
diff --git a/firmware/libcommon/source/mode_cardemu.c 
b/firmware/libcommon/source/mode_cardemu.c
index c7362cf..b1d9c7a 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -17,6 +17,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
  */
 #include "board.h"
+#include "boardver_adc.h"
 #include "simtrace.h"
 #include "ringbuffer.h"
 #include "card_emu.h"
@@ -296,7 +297,6 @@
        return 0;
 }

-#define UV_PER_LSB     ((3300 * 1000) / 4096)
 #define VCC_UV_THRESH_1V8      1500000
 #define VCC_UV_THRESH_3V       2800000

@@ -316,12 +316,6 @@
        ci->vcc_uv_last = ci->vcc_uv;
 }

-static uint32_t adc2uv(uint16_t adc)
-{
-       uint32_t uv = (uint32_t) adc * UV_PER_LSB;
-       return uv;
-}
-
 void ADC_IrqHandler(void)
 {
 #ifdef CARDEMU_SECOND_UART

--
To view, visit https://gerrit.osmocom.org/9964
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8a772638fa8dd02d8bc8b7631de5af5a22647c55
Gerrit-Change-Number: 9964
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon <kre...@sysmocom.de>

Reply via email to