Compare commits
3 Commits
1469633a9e
...
b7a476ddef
Author | SHA1 | Date | |
---|---|---|---|
|
b7a476ddef | ||
|
6ea9013592 | ||
|
aa0c411d44 |
@ -32,8 +32,16 @@
|
||||
* @brief Added the brand new altimeter app, updated the way the accelerometer is initialized
|
||||
*
|
||||
*/
|
||||
#define FIRMWARE_VERSION "0.0.5"
|
||||
//#define FIRMWARE_VERSION "0.0.5"
|
||||
|
||||
/**
|
||||
* @brief Reworked the altimeter app to display the time and date on the altitude screen,
|
||||
* added a PMU related function to start the 32k OSC calibration routine.
|
||||
* Added 'û' and 'Û' characters to the LVGL font.
|
||||
* Other minor changes.
|
||||
*
|
||||
*/
|
||||
#define FIRMWARE_VERSION "0.0.6"
|
||||
|
||||
|
||||
#define FIRMWARE_COMPILATION_TIME_DATE (__TIME__" "__DATE__)
|
||||
|
@ -897,8 +897,9 @@ void gfx_task(void *param)
|
||||
}
|
||||
|
||||
/* Perform the periodic background tasks */
|
||||
APP_LOG_INFO("Periodic timer wakeup !");
|
||||
|
||||
APP_LOG_INFO("Periodic timer wakeup :"NEW_LINE
|
||||
"\t - RTC calibration : %d", tls_pmu_32k_calibrate());
|
||||
|
||||
} while (watch_peripherals_wakeup_source_is_timer());
|
||||
|
||||
/* On wake up, we force the watch face to sync up with the rtc /!\ RTC update delay WTF ? */
|
||||
@ -910,7 +911,7 @@ void gfx_task(void *param)
|
||||
_perform_deferred_display_wake_up_set_timestamp();
|
||||
}
|
||||
|
||||
// Necessary to not enter the if condition over and over again
|
||||
// Necessary TO NOT enter the if condition over and over again
|
||||
lv_disp_trig_activity(NULL);
|
||||
}
|
||||
|
||||
|
@ -148,14 +148,14 @@ void tls_pmu_clk_select(u8 bypass);
|
||||
|
||||
/** NOT PART OF THE OFFICIAL SDK **/
|
||||
/**
|
||||
* @brief Starts the internal 32K oscillator calibration cycle.
|
||||
* @brief Starts the internal 32K oscillator calibration cycle using the PMU's calibration circuit.
|
||||
*
|
||||
* @param None
|
||||
* @param None
|
||||
*
|
||||
* @return None
|
||||
* @return true if successful, false otherwise
|
||||
*
|
||||
*/
|
||||
void tls_pmu_clk_calibrate(void);
|
||||
bool tls_pmu_32k_calibrate(void);
|
||||
/**********************************/
|
||||
|
||||
|
||||
|
@ -188,6 +188,34 @@ void tls_pmu_clk_select(u8 bypass)
|
||||
tls_reg_write32(HR_PMU_PS_CR, val);
|
||||
}
|
||||
|
||||
/** NOT PART OF THE OFFICIAL SDK **/
|
||||
bool tls_pmu_32k_calibrate(void)
|
||||
{
|
||||
/* To start the calibration procedure, the bit 3 needs to be set to 0 and then 1 */
|
||||
unsigned int pmu_ps_cr = tls_reg_read32(HR_PMU_PS_CR);
|
||||
|
||||
/* First make sure the bit 3 is 0 */
|
||||
if((pmu_ps_cr & BIT(3)) != 0)
|
||||
{
|
||||
pmu_ps_cr &= ~(BIT(3));
|
||||
tls_reg_write32(HR_PMU_PS_CR, pmu_ps_cr);
|
||||
}
|
||||
|
||||
pmu_ps_cr = tls_reg_read32(HR_PMU_PS_CR);
|
||||
if((pmu_ps_cr & BIT(3)) == 0)
|
||||
{
|
||||
/* Then flip it to one */
|
||||
pmu_ps_cr |= BIT(3);
|
||||
tls_reg_write32(HR_PMU_PS_CR, pmu_ps_cr);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/**********************************/
|
||||
|
||||
/**
|
||||
* @brief This function is used to start pmu timer0
|
||||
|
@ -84,12 +84,14 @@ void tls_get_rtc(struct tm *tblock)
|
||||
tblock->tm_sec = ctrl1 & 0x0000003f;
|
||||
}
|
||||
|
||||
/** NOT PART OF THE OFFICIAL SDK **/
|
||||
bool tls_is_rtc_running(void)
|
||||
{
|
||||
int ctrl2 = tls_reg_read32(HR_PMU_RTC_CTRL2);
|
||||
|
||||
return ctrl2 & (1 << 16) ? true : false;
|
||||
}
|
||||
/**********************************/
|
||||
|
||||
void PMU_RTC_IRQHandler(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user