[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-05 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-772985567







This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773687640


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-772985131


   
   
   
   ## RAT Report (2021-02-04 02:46:05)
   
   ## New files with unknown licenses
   
   * https://github.com/apache/mynewt-core/blob/2fc4dc30408d87955342081c77f4e01350e5ba4a/hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c";>hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/COPYING-BSD-3";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/COPYING-BSD-3
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_adc16.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_adc16.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cache.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cache.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cache.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cache.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cmp.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cmp.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cmt.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cmt.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_common.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_common.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_common.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_common.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dac.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dac.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dmamux.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dmamux.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dspi.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dspi.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dspi_edma.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dspi_edma.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_edma.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_edma.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_enet.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_enet.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_enet.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_enet.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_ewm.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_ewm.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flash.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flash.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexbus.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexbus.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexcan.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexcan.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexcan.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexcan.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio_camera.c";>hw/mcu/nxp/src/e

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773684122


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773679886


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773628578


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773627492


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773621689


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773611592


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773602942


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773588514


   
   
   
   ## Style check summary
   
    No suggestions at this time!
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773584274


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c
   
   
   ```diff
   @@ -187,15 +187,15 @@
 
**/

#ifndef MCG_USER_CONFIG_FLL_STABLE_DELAY_EN
   -static void CLOCK_FllStableDelay(void)
   +static void
   +CLOCK_FllStableDelay(void)
{
/*
   Should wait at least 1ms. Because in these modes, the core clock is 
100MHz
   at most, so this function could obtain the 1ms delay.
 */
volatile uint32_t i = 3U;
   -while (0U != (i--))
   -{
   +while (0U != (i--)) {
__NOP();
}
}
   @@ -207,34 +207,35 @@
extern void CLOCK_FllStableDelay(void);
#endif /* MCG_USER_CONFIG_FLL_STABLE_DELAY_EN */

   -static uint32_t CLOCK_GetMcgExtClkFreq(void)
   +static uint32_t
   +CLOCK_GetMcgExtClkFreq(void)
{
uint32_t freq;

   -switch (MCG_C7_OSCSEL_VAL)
   -{
   -case 0U:
   -/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   -assert(0U != g_xtal0Freq);
   -freq = g_xtal0Freq;
   -break;
   -case 1U:
   -/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   -assert(0U != g_xtal32Freq);
   -freq = g_xtal32Freq;
   -break;
   -case 2U:
   -freq = MCG_INTERNAL_IRC_48M;
   -break;
   -default:
   -freq = 0U;
   -break;
   +switch (MCG_C7_OSCSEL_VAL) {
   +case 0U:
   +/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   +assert(0U != g_xtal0Freq);
   +freq = g_xtal0Freq;
   +break;
   +case 1U:
   +/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   +assert(0U != g_xtal32Freq);
   +freq = g_xtal32Freq;
   +break;
   +case 2U:
   +freq = MCG_INTERNAL_IRC_48M;
   +break;
   +default:
   +freq = 0U;
   +break;
}

return freq;
}

   -static uint32_t CLOCK_GetFllExtRefClkFreq(void)
   +static uint32_t
   +CLOCK_GetFllExtRefClkFreq(void)
{
/* FllExtRef = McgExtRef / FllExtRefDiv */
uint8_t frdiv;
   @@ -246,54 +247,50 @@
frdiv = MCG_C1_FRDIV_VAL;
freq >>= frdiv;

   -range  = MCG_C2_RANGE_VAL;
   +range = MCG_C2_RANGE_VAL;
oscsel = MCG_C7_OSCSEL_VAL;

/*
   When should use divider 32, 64, 128, 256, 512, 1024, 1280, 1536.
   1. MCG_C7[OSCSEL] selects IRC48M.
   2. MCG_C7[OSCSEL] selects OSC0 and MCG_C2[RANGE] is not 0.
   -*/
   -if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel))
   -{
   -switch (frdiv)
   -{
   -case 0:
   -case 1:
   -case 2:
   -case 3:
   -case 4:
   -case 5:
   -freq >>= 5u;
   -break;
   -case 6:
   -/* 64*20=1280 */
   -freq /= 20u;
   -break;
   -case 7:
   -/* 128*12=1536 */
   -freq /= 12u;
   -break;
   -default:
   -freq = 0u;
   -break;
   + */
   +if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel)) {
   +switch (frdiv) {
   +case 0:
   +case 1:
   +case 2:
   +case 3:
   +case 4:
   +case 5:
   +freq >>= 5u;
   +break;
   +case 6:
   +/* 64*20=1280 */
   +freq /= 20u;
   +break;
   +case 7:
   +/* 128*12=1536 */
   +freq /= 12u;
   +break;
   +default:
   +freq = 0u;
   +break;
}
}

return freq;
}

   -static uint32_t CLOCK_GetInternalRefClkSelectFreq(void)
   +static uint32_t
   +CLOCK_GetInternalRefClkSelectFreq(void)
{
uint32_t freq;

   -if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL)
   -{
   +if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL) {
/* Slow internal reference clock selected*/
freq = s_slowIrcFreq;
   -}
   -else
   -{
   +} else   {
/* Fast internal reference clock selected*/
freq = s_fastIrcFreq >> MCG_SC_FCRDIV

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773577569


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c
   
   
   ```diff
   @@ -187,15 +187,15 @@
 
**/

#ifndef MCG_USER_CONFIG_FLL_STABLE_DELAY_EN
   -static void CLOCK_FllStableDelay(void)
   +static void
   +CLOCK_FllStableDelay(void)
{
/*
   Should wait at least 1ms. Because in these modes, the core clock is 
100MHz
   at most, so this function could obtain the 1ms delay.
 */
volatile uint32_t i = 3U;
   -while (0U != (i--))
   -{
   +while (0U != (i--)) {
__NOP();
}
}
   @@ -207,34 +207,35 @@
extern void CLOCK_FllStableDelay(void);
#endif /* MCG_USER_CONFIG_FLL_STABLE_DELAY_EN */

   -static uint32_t CLOCK_GetMcgExtClkFreq(void)
   +static uint32_t
   +CLOCK_GetMcgExtClkFreq(void)
{
uint32_t freq;

   -switch (MCG_C7_OSCSEL_VAL)
   -{
   -case 0U:
   -/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   -assert(0U != g_xtal0Freq);
   -freq = g_xtal0Freq;
   -break;
   -case 1U:
   -/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   -assert(0U != g_xtal32Freq);
   -freq = g_xtal32Freq;
   -break;
   -case 2U:
   -freq = MCG_INTERNAL_IRC_48M;
   -break;
   -default:
   -freq = 0U;
   -break;
   +switch (MCG_C7_OSCSEL_VAL) {
   +case 0U:
   +/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   +assert(0U != g_xtal0Freq);
   +freq = g_xtal0Freq;
   +break;
   +case 1U:
   +/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   +assert(0U != g_xtal32Freq);
   +freq = g_xtal32Freq;
   +break;
   +case 2U:
   +freq = MCG_INTERNAL_IRC_48M;
   +break;
   +default:
   +freq = 0U;
   +break;
}

return freq;
}

   -static uint32_t CLOCK_GetFllExtRefClkFreq(void)
   +static uint32_t
   +CLOCK_GetFllExtRefClkFreq(void)
{
/* FllExtRef = McgExtRef / FllExtRefDiv */
uint8_t frdiv;
   @@ -246,54 +247,50 @@
frdiv = MCG_C1_FRDIV_VAL;
freq >>= frdiv;

   -range  = MCG_C2_RANGE_VAL;
   +range = MCG_C2_RANGE_VAL;
oscsel = MCG_C7_OSCSEL_VAL;

/*
   When should use divider 32, 64, 128, 256, 512, 1024, 1280, 1536.
   1. MCG_C7[OSCSEL] selects IRC48M.
   2. MCG_C7[OSCSEL] selects OSC0 and MCG_C2[RANGE] is not 0.
   -*/
   -if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel))
   -{
   -switch (frdiv)
   -{
   -case 0:
   -case 1:
   -case 2:
   -case 3:
   -case 4:
   -case 5:
   -freq >>= 5u;
   -break;
   -case 6:
   -/* 64*20=1280 */
   -freq /= 20u;
   -break;
   -case 7:
   -/* 128*12=1536 */
   -freq /= 12u;
   -break;
   -default:
   -freq = 0u;
   -break;
   + */
   +if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel)) {
   +switch (frdiv) {
   +case 0:
   +case 1:
   +case 2:
   +case 3:
   +case 4:
   +case 5:
   +freq >>= 5u;
   +break;
   +case 6:
   +/* 64*20=1280 */
   +freq /= 20u;
   +break;
   +case 7:
   +/* 128*12=1536 */
   +freq /= 12u;
   +break;
   +default:
   +freq = 0u;
   +break;
}
}

return freq;
}

   -static uint32_t CLOCK_GetInternalRefClkSelectFreq(void)
   +static uint32_t
   +CLOCK_GetInternalRefClkSelectFreq(void)
{
uint32_t freq;

   -if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL)
   -{
   +if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL) {
/* Slow internal reference clock selected*/
freq = s_slowIrcFreq;
   -}
   -else
   -{
   +} else   {
/* Fast internal reference clock selected*/
freq = s_fastIrcFreq >> MCG_SC_FCRDIV

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-773567186


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c
   
   
   ```diff
   @@ -187,15 +187,15 @@
 
**/

#ifndef MCG_USER_CONFIG_FLL_STABLE_DELAY_EN
   -static void CLOCK_FllStableDelay(void)
   +static void
   +CLOCK_FllStableDelay(void)
{
/*
   Should wait at least 1ms. Because in these modes, the core clock is 
100MHz
   at most, so this function could obtain the 1ms delay.
 */
volatile uint32_t i = 3U;
   -while (0U != (i--))
   -{
   +while (0U != (i--)) {
__NOP();
}
}
   @@ -207,34 +207,35 @@
extern void CLOCK_FllStableDelay(void);
#endif /* MCG_USER_CONFIG_FLL_STABLE_DELAY_EN */

   -static uint32_t CLOCK_GetMcgExtClkFreq(void)
   +static uint32_t
   +CLOCK_GetMcgExtClkFreq(void)
{
uint32_t freq;

   -switch (MCG_C7_OSCSEL_VAL)
   -{
   -case 0U:
   -/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   -assert(0U != g_xtal0Freq);
   -freq = g_xtal0Freq;
   -break;
   -case 1U:
   -/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   -assert(0U != g_xtal32Freq);
   -freq = g_xtal32Freq;
   -break;
   -case 2U:
   -freq = MCG_INTERNAL_IRC_48M;
   -break;
   -default:
   -freq = 0U;
   -break;
   +switch (MCG_C7_OSCSEL_VAL) {
   +case 0U:
   +/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   +assert(0U != g_xtal0Freq);
   +freq = g_xtal0Freq;
   +break;
   +case 1U:
   +/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   +assert(0U != g_xtal32Freq);
   +freq = g_xtal32Freq;
   +break;
   +case 2U:
   +freq = MCG_INTERNAL_IRC_48M;
   +break;
   +default:
   +freq = 0U;
   +break;
}

return freq;
}

   -static uint32_t CLOCK_GetFllExtRefClkFreq(void)
   +static uint32_t
   +CLOCK_GetFllExtRefClkFreq(void)
{
/* FllExtRef = McgExtRef / FllExtRefDiv */
uint8_t frdiv;
   @@ -246,54 +247,50 @@
frdiv = MCG_C1_FRDIV_VAL;
freq >>= frdiv;

   -range  = MCG_C2_RANGE_VAL;
   +range = MCG_C2_RANGE_VAL;
oscsel = MCG_C7_OSCSEL_VAL;

/*
   When should use divider 32, 64, 128, 256, 512, 1024, 1280, 1536.
   1. MCG_C7[OSCSEL] selects IRC48M.
   2. MCG_C7[OSCSEL] selects OSC0 and MCG_C2[RANGE] is not 0.
   -*/
   -if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel))
   -{
   -switch (frdiv)
   -{
   -case 0:
   -case 1:
   -case 2:
   -case 3:
   -case 4:
   -case 5:
   -freq >>= 5u;
   -break;
   -case 6:
   -/* 64*20=1280 */
   -freq /= 20u;
   -break;
   -case 7:
   -/* 128*12=1536 */
   -freq /= 12u;
   -break;
   -default:
   -freq = 0u;
   -break;
   + */
   +if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel)) {
   +switch (frdiv) {
   +case 0:
   +case 1:
   +case 2:
   +case 3:
   +case 4:
   +case 5:
   +freq >>= 5u;
   +break;
   +case 6:
   +/* 64*20=1280 */
   +freq /= 20u;
   +break;
   +case 7:
   +/* 128*12=1536 */
   +freq /= 12u;
   +break;
   +default:
   +freq = 0u;
   +break;
}
}

return freq;
}

   -static uint32_t CLOCK_GetInternalRefClkSelectFreq(void)
   +static uint32_t
   +CLOCK_GetInternalRefClkSelectFreq(void)
{
uint32_t freq;

   -if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL)
   -{
   +if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL) {
/* Slow internal reference clock selected*/
freq = s_slowIrcFreq;
   -}
   -else
   -{
   +} else   {
/* Fast internal reference clock selected*/
freq = s_fastIrcFreq >> MCG_SC_FCRDIV

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-04 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-772985567


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c
   
   
   ```diff
   @@ -187,15 +187,15 @@
 
**/

#ifndef MCG_USER_CONFIG_FLL_STABLE_DELAY_EN
   -static void CLOCK_FllStableDelay(void)
   +static void
   +CLOCK_FllStableDelay(void)
{
/*
   Should wait at least 1ms. Because in these modes, the core clock is 
100MHz
   at most, so this function could obtain the 1ms delay.
 */
volatile uint32_t i = 3U;
   -while (0U != (i--))
   -{
   +while (0U != (i--)) {
__NOP();
}
}
   @@ -207,34 +207,35 @@
extern void CLOCK_FllStableDelay(void);
#endif /* MCG_USER_CONFIG_FLL_STABLE_DELAY_EN */

   -static uint32_t CLOCK_GetMcgExtClkFreq(void)
   +static uint32_t
   +CLOCK_GetMcgExtClkFreq(void)
{
uint32_t freq;

   -switch (MCG_C7_OSCSEL_VAL)
   -{
   -case 0U:
   -/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   -assert(0U != g_xtal0Freq);
   -freq = g_xtal0Freq;
   -break;
   -case 1U:
   -/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   -assert(0U != g_xtal32Freq);
   -freq = g_xtal32Freq;
   -break;
   -case 2U:
   -freq = MCG_INTERNAL_IRC_48M;
   -break;
   -default:
   -freq = 0U;
   -break;
   +switch (MCG_C7_OSCSEL_VAL) {
   +case 0U:
   +/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   +assert(0U != g_xtal0Freq);
   +freq = g_xtal0Freq;
   +break;
   +case 1U:
   +/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   +assert(0U != g_xtal32Freq);
   +freq = g_xtal32Freq;
   +break;
   +case 2U:
   +freq = MCG_INTERNAL_IRC_48M;
   +break;
   +default:
   +freq = 0U;
   +break;
}

return freq;
}

   -static uint32_t CLOCK_GetFllExtRefClkFreq(void)
   +static uint32_t
   +CLOCK_GetFllExtRefClkFreq(void)
{
/* FllExtRef = McgExtRef / FllExtRefDiv */
uint8_t frdiv;
   @@ -246,54 +247,50 @@
frdiv = MCG_C1_FRDIV_VAL;
freq >>= frdiv;

   -range  = MCG_C2_RANGE_VAL;
   +range = MCG_C2_RANGE_VAL;
oscsel = MCG_C7_OSCSEL_VAL;

/*
   When should use divider 32, 64, 128, 256, 512, 1024, 1280, 1536.
   1. MCG_C7[OSCSEL] selects IRC48M.
   2. MCG_C7[OSCSEL] selects OSC0 and MCG_C2[RANGE] is not 0.
   -*/
   -if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel))
   -{
   -switch (frdiv)
   -{
   -case 0:
   -case 1:
   -case 2:
   -case 3:
   -case 4:
   -case 5:
   -freq >>= 5u;
   -break;
   -case 6:
   -/* 64*20=1280 */
   -freq /= 20u;
   -break;
   -case 7:
   -/* 128*12=1536 */
   -freq /= 12u;
   -break;
   -default:
   -freq = 0u;
   -break;
   + */
   +if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel)) {
   +switch (frdiv) {
   +case 0:
   +case 1:
   +case 2:
   +case 3:
   +case 4:
   +case 5:
   +freq >>= 5u;
   +break;
   +case 6:
   +/* 64*20=1280 */
   +freq /= 20u;
   +break;
   +case 7:
   +/* 128*12=1536 */
   +freq /= 12u;
   +break;
   +default:
   +freq = 0u;
   +break;
}
}

return freq;
}

   -static uint32_t CLOCK_GetInternalRefClkSelectFreq(void)
   +static uint32_t
   +CLOCK_GetInternalRefClkSelectFreq(void)
{
uint32_t freq;

   -if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL)
   -{
   +if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL) {
/* Slow internal reference clock selected*/
freq = s_slowIrcFreq;
   -}
   -else
   -{
   +} else   {
/* Fast internal reference clock selected*/
freq = s_fastIrcFreq >> MCG_SC_FCRDIV

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-03 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-772981680


   
   
   
   ## Style check summary
   
   ### Our coding style is 
[here!](https://github.com/apache/mynewt-core/blob/master/CODING_STANDARDS.md)
   
   
    hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c
   
   
   ```diff
   @@ -187,15 +187,15 @@
 
**/

#ifndef MCG_USER_CONFIG_FLL_STABLE_DELAY_EN
   -static void CLOCK_FllStableDelay(void)
   +static void
   +CLOCK_FllStableDelay(void)
{
/*
   Should wait at least 1ms. Because in these modes, the core clock is 
100MHz
   at most, so this function could obtain the 1ms delay.
 */
volatile uint32_t i = 3U;
   -while (0U != (i--))
   -{
   +while (0U != (i--)) {
__NOP();
}
}
   @@ -207,34 +207,35 @@
extern void CLOCK_FllStableDelay(void);
#endif /* MCG_USER_CONFIG_FLL_STABLE_DELAY_EN */

   -static uint32_t CLOCK_GetMcgExtClkFreq(void)
   +static uint32_t
   +CLOCK_GetMcgExtClkFreq(void)
{
uint32_t freq;

   -switch (MCG_C7_OSCSEL_VAL)
   -{
   -case 0U:
   -/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   -assert(0U != g_xtal0Freq);
   -freq = g_xtal0Freq;
   -break;
   -case 1U:
   -/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   -assert(0U != g_xtal32Freq);
   -freq = g_xtal32Freq;
   -break;
   -case 2U:
   -freq = MCG_INTERNAL_IRC_48M;
   -break;
   -default:
   -freq = 0U;
   -break;
   +switch (MCG_C7_OSCSEL_VAL) {
   +case 0U:
   +/* Please call CLOCK_SetXtal0Freq base on board setting before 
using OSC0 clock. */
   +assert(0U != g_xtal0Freq);
   +freq = g_xtal0Freq;
   +break;
   +case 1U:
   +/* Please call CLOCK_SetXtal32Freq base on board setting before 
using XTAL32K/RTC_CLKIN clock. */
   +assert(0U != g_xtal32Freq);
   +freq = g_xtal32Freq;
   +break;
   +case 2U:
   +freq = MCG_INTERNAL_IRC_48M;
   +break;
   +default:
   +freq = 0U;
   +break;
}

return freq;
}

   -static uint32_t CLOCK_GetFllExtRefClkFreq(void)
   +static uint32_t
   +CLOCK_GetFllExtRefClkFreq(void)
{
/* FllExtRef = McgExtRef / FllExtRefDiv */
uint8_t frdiv;
   @@ -246,54 +247,50 @@
frdiv = MCG_C1_FRDIV_VAL;
freq >>= frdiv;

   -range  = MCG_C2_RANGE_VAL;
   +range = MCG_C2_RANGE_VAL;
oscsel = MCG_C7_OSCSEL_VAL;

/*
   When should use divider 32, 64, 128, 256, 512, 1024, 1280, 1536.
   1. MCG_C7[OSCSEL] selects IRC48M.
   2. MCG_C7[OSCSEL] selects OSC0 and MCG_C2[RANGE] is not 0.
   -*/
   -if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel))
   -{
   -switch (frdiv)
   -{
   -case 0:
   -case 1:
   -case 2:
   -case 3:
   -case 4:
   -case 5:
   -freq >>= 5u;
   -break;
   -case 6:
   -/* 64*20=1280 */
   -freq /= 20u;
   -break;
   -case 7:
   -/* 128*12=1536 */
   -freq /= 12u;
   -break;
   -default:
   -freq = 0u;
   -break;
   + */
   +if (((0U != range) && ((uint8_t)kMCG_OscselOsc == oscsel)) || 
((uint8_t)kMCG_OscselIrc == oscsel)) {
   +switch (frdiv) {
   +case 0:
   +case 1:
   +case 2:
   +case 3:
   +case 4:
   +case 5:
   +freq >>= 5u;
   +break;
   +case 6:
   +/* 64*20=1280 */
   +freq /= 20u;
   +break;
   +case 7:
   +/* 128*12=1536 */
   +freq /= 12u;
   +break;
   +default:
   +freq = 0u;
   +break;
}
}

return freq;
}

   -static uint32_t CLOCK_GetInternalRefClkSelectFreq(void)
   +static uint32_t
   +CLOCK_GetInternalRefClkSelectFreq(void)
{
uint32_t freq;

   -if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL)
   -{
   +if ((uint8_t)kMCG_IrcSlow == MCG_S_IRCST_VAL) {
/* Slow internal reference clock selected*/
freq = s_slowIrcFreq;
   -}
   -else
   -{
   +} else   {
/* Fast internal reference clock selected*/
freq = s_fastIrcFreq >> MCG_SC_FCRDIV

[GitHub] [mynewt-core] apache-mynewt-bot removed a comment on pull request #2466: mcu/nxp: Update NXP SDK and add Kinetis common HAL.

2021-02-03 Thread GitBox


apache-mynewt-bot removed a comment on pull request #2466:
URL: https://github.com/apache/mynewt-core/pull/2466#issuecomment-772981003


   
   
   
   ## RAT Report (2021-02-04 02:38:07)
   
   ## New files with unknown licenses
   
   * https://github.com/apache/mynewt-core/blob/f6f51c9b0beb48dbf993fb0a1895d4ffdc4a2ec7/hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c";>hw/mcu/nxp/kinetis/MK64F12/src/fsl_clock.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/COPYING-BSD-3";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/COPYING-BSD-3
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_adc16.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_adc16.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cache.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cache.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cache.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cache.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cmp.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cmp.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cmt.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_cmt.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_common.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_common.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_common.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_common.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dac.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dac.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dmamux.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dmamux.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dspi.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dspi.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dspi_edma.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_dspi_edma.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_edma.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_edma.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_enet.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_enet.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_enet.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_enet.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_ewm.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_ewm.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flash.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flash.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexbus.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexbus.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexcan.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexcan.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexcan.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexcan.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio.c";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio.c
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio.h";>hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio.h
   * https://github.com/apache/mynewt-core/blob/acb97e0e64c79d41dea861c139e3983c20982553/hw/mcu/nxp/src/ext/nxp-kinetis-sdk/drivers/fsl_flexio_camera.c";>hw/mcu/nxp/src/e