mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-16 05:42:56 +00:00
- in case of mdk conflict to use nrfx v2
- allow to force nrfx version with CFG_TUD_NRF_NRFX_VERSION=1
This commit is contained in:
parent
37a05e0264
commit
d82ee79bd0
@ -56,25 +56,24 @@
|
|||||||
#include "mcu/mcu.h"
|
#include "mcu/mcu.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Unfortunately there are API differences between nrfx<2.0.0 and nrfx>=2.0.0
|
/* Try to detect nrfx version if not configured with CFG_TUD_NRF_NRFX_VERSION
|
||||||
// Nordic actually has generated a mess here: nrfx==1.9.0 has MDK 8.40.3 while nrfx==2.0.0 has MDK 8.29.0.
|
* nrfx v1 and v2 are concurrently developed. There is no NRFX_VERSION only MDK VERSION which is as follows:
|
||||||
// See the below statement to catch all nrfx versions with an old API.
|
* - v2.6.0: 8.44.1, v2.5.0: 8.40.2, v2.4.0: 8.37.0, v2.3.0: 8.35.0, v2.2.0: 8.32.1, v2.1.0: 8.30.2, v2.0.0: 8.29.0
|
||||||
#define _MDK_VERSION 10000*MDK_MAJOR_VERSION + 100*MDK_MINOR_VERSION + MDK_MICRO_VERSION
|
* - v1.9.0: 8.40.3, v1.8.6: 8.35.0 (conflict with v2.3.0), v1.8.5: 8.32.3, v1.8.4: 8.32.1 (conflict with v2.2.0),
|
||||||
#if _MDK_VERSION <= 82701
|
* v1.8.2: 8.32.1 (conflict with v2.2.0), v1.8.1: 8.27.1
|
||||||
// nrfx <= 1.8.1
|
* Therefore the check for v1 would be:
|
||||||
#define NORDIC_SDK_OLD_API
|
* - MDK < 8.29.0 (v2.0), MDK == 8.32.3, 8.40.3
|
||||||
#elif _MDK_VERSION == 83201
|
* - in case of conflict User of those version must upgrade to other 1.x version or set CFG_TUD_NRF_NRFX_VERSION
|
||||||
// nrfx 1.8.2 / 1.8.4
|
*/
|
||||||
#define NORDIC_SDK_OLD_API
|
#ifndef CFG_TUD_NRF_NRFX_VERSION
|
||||||
#elif _MDK_VERSION == 83203
|
#define _MDK_VERSION (10000*MDK_MAJOR_VERSION + 100*MDK_MINOR_VERSION + MDK_MICRO_VERSION)
|
||||||
// nrfx 1.8.5
|
|
||||||
#define NORDIC_SDK_OLD_API
|
#if _MDK_VERSION < 82900 || _MDK_VERSION == 83203 || _MDK_VERSION == 84003
|
||||||
#elif _MDK_VERSION == 83500
|
// nrfx <= 1.8.1, or 1.8.5 or 1.9.0
|
||||||
// nrfx 1.8.6
|
#define CFG_TUD_NRF_NRFX_VERSION 1
|
||||||
#define NORDIC_SDK_OLD_API
|
#else
|
||||||
#elif _MDK_VERSION == 84003
|
#define CFG_TUD_NRF_NRFX_VERSION 2
|
||||||
// nrfx 1.9.0
|
#endif
|
||||||
#define NORDIC_SDK_OLD_API
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
@ -921,7 +920,7 @@ static bool hfclk_running(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NORDIC_SDK_OLD_API
|
#if CFG_TUD_NRF_NRFX_VERSION == 1
|
||||||
return nrf_clock_hf_is_running(NRF_CLOCK_HFCLK_HIGH_ACCURACY);
|
return nrf_clock_hf_is_running(NRF_CLOCK_HFCLK_HIGH_ACCURACY);
|
||||||
#else
|
#else
|
||||||
return nrf_clock_hf_is_running(NRF_CLOCK, NRF_CLOCK_HFCLK_HIGH_ACCURACY);
|
return nrf_clock_hf_is_running(NRF_CLOCK, NRF_CLOCK_HFCLK_HIGH_ACCURACY);
|
||||||
@ -946,7 +945,7 @@ static void hfclk_enable(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NORDIC_SDK_OLD_API
|
#if CFG_TUD_NRF_NRFX_VERSION == 1
|
||||||
nrf_clock_event_clear(NRF_CLOCK_EVENT_HFCLKSTARTED);
|
nrf_clock_event_clear(NRF_CLOCK_EVENT_HFCLKSTARTED);
|
||||||
nrf_clock_task_trigger(NRF_CLOCK_TASK_HFCLKSTART);
|
nrf_clock_task_trigger(NRF_CLOCK_TASK_HFCLKSTART);
|
||||||
#else
|
#else
|
||||||
@ -971,7 +970,7 @@ static void hfclk_disable(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NORDIC_SDK_OLD_API
|
#if CFG_TUD_NRF_NRFX_VERSION == 1
|
||||||
nrf_clock_task_trigger(NRF_CLOCK_TASK_HFCLKSTOP);
|
nrf_clock_task_trigger(NRF_CLOCK_TASK_HFCLKSTOP);
|
||||||
#else
|
#else
|
||||||
nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_HFCLKSTOP);
|
nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_HFCLKSTOP);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user