From 5b0259dbd1779d0c8bbdbe9d944b425bb945b195 Mon Sep 17 00:00:00 2001 From: Steve Cartmell Date: Tue, 18 Dec 2018 16:13:58 +0000 Subject: [PATCH] fix(hal-watchdog): Guard TMPM 'ResetReason' code behind feature flag --- targets/TARGET_TOSHIBA/TARGET_TMPM066/reset_reason_api.c | 7 ++++++- targets/TARGET_TOSHIBA/TARGET_TMPM3H6/reset_reason_api.c | 7 ++++++- targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/reset_reason_api.c | 7 ++++++- targets/TARGET_TOSHIBA/TARGET_TMPM46B/reset_reason_api.c | 7 ++++++- targets/TARGET_TOSHIBA/TARGET_TMPM4G9/reset_reason_api.c | 7 ++++++- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM066/reset_reason_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM066/reset_reason_api.c index f5bd6230ce..817a1f489f 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM066/reset_reason_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM066/reset_reason_api.c @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include #include "reset_reason_api.h" + +#ifdef DEVICE_RESET_REASON + #include "TMPM066.h" +#include #define MAXRSTREASON 6 @@ -121,3 +124,5 @@ static uint8_t bit_pos(uint32_t reg) } } } + +#endif // DEVICE_RESET_REASON diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM3H6/reset_reason_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM3H6/reset_reason_api.c index 6531df6458..d5b50a952b 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM3H6/reset_reason_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM3H6/reset_reason_api.c @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include #include "reset_reason_api.h" + +#ifdef DEVICE_RESET_REASON + #include "TMPM3H6.h" +#include static uint8_t set_bit_count(uint32_t reg); static uint8_t bit_pos(uint32_t reg); @@ -118,3 +121,5 @@ static uint8_t bit_pos(uint32_t reg) } } } + +#endif // DEVICE_RESET_REASON diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/reset_reason_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/reset_reason_api.c index 5d9c5175d3..f5873ea798 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/reset_reason_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM3HQ/reset_reason_api.c @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include #include "reset_reason_api.h" + +#ifdef DEVICE_RESET_REASON + #include "TMPM3HQ.h" +#include static uint8_t set_bit_count(uint32_t reg); static uint8_t bit_pos(uint32_t reg); @@ -118,3 +121,5 @@ static uint8_t bit_pos(uint32_t reg) } } } + +#endif // DEVICE_RESET_REASON diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM46B/reset_reason_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM46B/reset_reason_api.c index af94dc4f55..1d6546fceb 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM46B/reset_reason_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM46B/reset_reason_api.c @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include #include "reset_reason_api.h" + +#ifdef DEVICE_RESET_REASON + #include "TMPM46B.h" +#include static uint8_t set_bit_count(uint32_t reg); static uint8_t bit_pos(uint32_t reg); @@ -87,3 +90,5 @@ static uint8_t bit_pos(uint32_t reg) } } } + +#endif // DEVICE_RESET_REASON diff --git a/targets/TARGET_TOSHIBA/TARGET_TMPM4G9/reset_reason_api.c b/targets/TARGET_TOSHIBA/TARGET_TMPM4G9/reset_reason_api.c index e02974aedc..36a2144ca8 100644 --- a/targets/TARGET_TOSHIBA/TARGET_TMPM4G9/reset_reason_api.c +++ b/targets/TARGET_TOSHIBA/TARGET_TMPM4G9/reset_reason_api.c @@ -13,9 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include #include "reset_reason_api.h" + +#ifdef DEVICE_RESET_REASON + #include "TMPM4G9.h" +#include static uint8_t set_bit_count(uint32_t reg); static uint8_t bit_pos(uint32_t reg); @@ -121,3 +124,5 @@ static uint8_t bit_pos(uint32_t reg) } } } + +#endif // DEVICE_RESET_REASON