Skip to content

Commit 2c10b93

Browse files
deal with not implemented functions
1 parent 8989e39 commit 2c10b93

File tree

2 files changed

+49
-22
lines changed

2 files changed

+49
-22
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/wsf/sources/port/baremetal/wsf_timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void WsfTimerInit(void)
208208
{
209209
WSF_QUEUE_INIT(&wsfTimerTimerQueue);
210210

211-
wsfTimerRtcLastTicks = PalRtcCounterGet();
211+
wsfTimerRtcLastTicks = 0;
212212
wsfTimerRtcRemainder = 0;
213213
}
214214

features/FEATURE_BLE/targets/TARGET_CORDIO/stack_adaptation/pal_mbed_os_adaptation.cpp

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,104 +18,131 @@
1818
#include "pal_types.h"
1919
#include "pal_uart.h"
2020
#include "pal_nvm.h"
21+
#include "hal/ticker_api.h"
2122

2223
#ifdef __cplusplus
2324
extern "C" {
2425
#endif
2526

27+
static const mbed_error_status_t function_not_implemented = MBED_MAKE_ERROR(MBED_MODULE_BLE, ENOSYS);
28+
#define NOT_IMPLEMENTED(name) MBED_ERROR(function_not_implemented, "Provide implementation of "name".");
29+
2630
/* UART */
2731

28-
PalUartState_t PalUartGetState(PalUartId_t id)
32+
MBED_WEAK PalUartState_t PalUartGetState(PalUartId_t id)
2933
{
34+
NOT_IMPLEMENTED("PalUartGetState");
35+
3036
return PAL_UART_STATE_UNINIT;
3137
}
3238

33-
void PalUartInit(PalUartId_t id, const PalUartConfig_t *pCfg)
39+
MBED_WEAK void PalUartInit(PalUartId_t id, const PalUartConfig_t *pCfg)
3440
{
41+
NOT_IMPLEMENTED("PalUartInit");
3542
}
3643

37-
void PalUartReadData(PalUartId_t id, uint8_t *pData, uint16_t len)
44+
MBED_WEAK void PalUartReadData(PalUartId_t id, uint8_t *pData, uint16_t len)
3845
{
46+
NOT_IMPLEMENTED("PalUartReadData");
3947
}
4048

41-
void PalUartWriteData(PalUartId_t id, const uint8_t *pData, uint16_t len)
49+
MBED_WEAK void PalUartWriteData(PalUartId_t id, const uint8_t *pData, uint16_t len)
4250
{
51+
NOT_IMPLEMENTED("PalUartWriteData");
4352
}
4453

4554
/* NVM */
4655

47-
void PalNvmInit(PalNvmCback_t actCback)
56+
MBED_WEAK void PalNvmInit(PalNvmCback_t actCback)
4857
{
58+
NOT_IMPLEMENTED("PalNvmInit");
4959
}
5060

51-
PalNvmState_t PalNvmGetState()
61+
MBED_WEAK PalNvmState_t PalNvmGetState()
5262
{
63+
NOT_IMPLEMENTED("PalNvmGetState");
64+
5365
return PAL_NVM_STATE_UNINIT;
5466
}
5567

56-
void PalNvmRead(void *pBuf, uint32_t size, uint32_t srcAddr)
68+
MBED_WEAK void PalNvmRead(MBED_WEAK void *pBuf, uint32_t size, uint32_t srcAddr)
5769
{
70+
NOT_IMPLEMENTED("PalNvmRead");
5871
}
5972

60-
void PalNvmWrite(void *pBuf, uint32_t size, uint32_t dstAddr)
73+
MBED_WEAK void PalNvmWrite(MBED_WEAK void *pBuf, uint32_t size, uint32_t dstAddr)
6174
{
75+
NOT_IMPLEMENTED("PalNvmWrite");
6276
}
6377

64-
void PalNvmEraseSector(uint32_t size, uint32_t startAddr)
78+
MBED_WEAK void PalNvmEraseSector(uint32_t size, uint32_t startAddr)
6579
{
80+
NOT_IMPLEMENTED("PalNvmEraseSector");
6681
}
6782

6883
/* LED */
6984

70-
void PalLedOn(uint8_t id)
85+
MBED_WEAK void PalLedOn(uint8_t id)
7186
{
87+
NOT_IMPLEMENTED("PalLedOn");
7288
}
7389

74-
void PalLedOff(uint8_t id)
90+
MBED_WEAK void PalLedOff(uint8_t id)
7591
{
92+
NOT_IMPLEMENTED("PalLedOff");
7693
}
7794

7895
/* RTC */
7996

80-
void PalRtcInit()
97+
MBED_WEAK void PalRtcInit()
8198
{
99+
NOT_IMPLEMENTED("PalRtcInit");
82100
}
83101

84-
void PalRtcEnableCompareIrq()
102+
MBED_WEAK void PalRtcEnableCompareIrq()
85103
{
104+
NOT_IMPLEMENTED("PalRtcEnableCompareIrq");
86105
}
87106

88-
void PalRtcDisableCompareIrq()
107+
MBED_WEAK void PalRtcDisableCompareIrq()
89108
{
109+
NOT_IMPLEMENTED("PalRtcDisableCompareIrq");
90110
}
91111

92-
uint32_t PalRtcCounterGet()
112+
MBED_WEAK uint32_t PalRtcCounterGet()
93113
{
94-
return 0;
114+
return osKernelGetTickCount();
95115
}
96116

97-
void PalRtcCompareSet(uint32_t value)
117+
MBED_WEAK void PalRtcCompareSet(uint32_t value)
98118
{
119+
NOT_IMPLEMENTED("PalRtcCompareSet");
99120
}
100121

101-
uint32_t PalRtcCompareGet()
122+
MBED_WEAK uint32_t PalRtcCompareGet()
102123
{
124+
NOT_IMPLEMENTED("PalRtcCompareGet");
125+
103126
return 0;
104127
}
105128

106129
/* SYS */
107130

108-
bool_t PalSysIsBusy()
131+
MBED_WEAK bool_t PalSysIsBusy()
109132
{
133+
NOT_IMPLEMENTED("PalSysIsBusy");
134+
110135
return 0;
111136
}
112137

113-
void PalSysAssertTrap()
138+
MBED_WEAK void PalSysAssertTrap()
114139
{
140+
NOT_IMPLEMENTED("PalSysAssertTrap");
115141
}
116142

117-
void PalSysSleep()
143+
MBED_WEAK void PalSysSleep()
118144
{
145+
NOT_IMPLEMENTED("PalSysSleep");
119146
}
120147

121148
#ifdef __cplusplus

0 commit comments

Comments
 (0)