/* PMU lock enable */
rcu_periph_clock_enable(RCU_PMU);
/* BKP clock enable */
rcu_periph_clock_enable(RCU_BKPI);
/* enable write access to the registers in backup domain */
pmu_backup_write_enable();
/* clear the bit flag of tamper event */
bkp_flag_clear(BKP_FLAG_TAMPER);
// /* tamper pin active level set */
// bkp_tamper_active_level_set(TAMPER_PIN_ACTIVE_HIGH);
/* tamper detection disable */
bkp_tamper_detection_disable();
/* disable the tamper interrupt */
bkp_tamper_interrupt_disable();
/* clear the bit flag of tamper event */
bkp_flag_clear(BKP_FLAG_TAMPER);
start_menu();
//备份寄存器 BKP_DATA_0 写1用于判断是否是刚上电,用于程序升级,更改参数等。0:表示刚上电 1:表示不是第一次上电
bkp_write_data(BKP_DATA_0, 1);
pmu_backup_write_disable();
|