This commit is contained in:
qiyongshuang
2024-11-11 14:32:11 +08:00
parent c4c38f507e
commit 961943f623
452 changed files with 9316 additions and 862 deletions
+13 -17
View File
@@ -12,11 +12,11 @@
/*
*@Note
*when LV is not enabled in standby mode, RAM 2k and 30K low-power data holding routines:
*This routine demonstrates writing data at the specified location of 2K RAM and 30K RAM,
*and then WFI enters STANDBY sleep mode, through the PA0 (wakeup) pin Input high level
*to exit standby mode, print RAM data after waking up, and test whether RAM is maintained
*data.
* when LV is not enabled in standby mode, RAM 2k and 30K data holding routines:
* This routine demonstrates writing data at the specified location of 2K RAM and 30K RAM(Applicable to
* CH32V20x_D8 and CH32V20x_D8W,CH32V20x_D6 has a 20K RAM data holding option),then WFI enters STANDBY
* sleep mode, through the PA0 (wakeup) pin Input high level to exit standby mode, print RAM data after
* waking up, and test whether RAM is maintained data.
*
*/
@@ -29,7 +29,7 @@
/*********************************************************************
* @fn TestDataWrite
*
* @brief Write 0x11111111 to certain address of 2K RAM and 30K RAM.
* @brief Write data to certain address of 2K RAM and 30K RAM.
*
* @return none
*/
@@ -55,7 +55,7 @@ void TestDataWrite(void)
{
*(uint32_t volatile *)(myAddr2+(i<<2)) = 0x33333333;
}
for(i=0;i<10;i++)//Check 30K RAM
for(i=0;i<10;i++)//Check 2K RAM
{
if((*(uint32_t volatile *)(myAddr2+(i<<2))) != 0x33333333)
{
@@ -126,16 +126,12 @@ int main(void)
/* Delay 1.5s to avoid entering low power mode immediately after reset*/
Delay_Ms(1500);
while(1)
{
TestDataRead();
printf("3.Stop RAM LV Mode Test\r\n");
TestDataWrite();
PWR_WakeUpPinCmd(ENABLE);
PWR_EnterSTANDBYMode_RAM();
printf("\r\n3.Out \r\n");
printf("\r\n ########## \r\n");
}
TestDataRead();
printf("Standby RAM Mode Test\r\n");
TestDataWrite();
PWR_WakeUpPinCmd(ENABLE);
PWR_EnterSTANDBYMode_RAM();
while(1);
}