Skip to content

STOP mode on CH32V203 ?? #242

@fulda1

Description

@fulda1

Hi All,

playing with one device, that have 2 power sources -> grid and battery. Pin PA0 indicate the source. PA0=1 means grid, PA0=0 means battery.
This one device is requested to sleep on battery mode with minimal consumption.

I expect following code will do all I need:

void PinUp() {} // empty function....

// .... in main, detected PA0 is low....
  attachInterrupt(PA0, GPIO_Mode_IN_FLOATING,  &PinUp, EXTI_Mode_Interrupt, EXTI_Trigger_Rising);
  PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFI);
  detachInterrupt(PA0);

unfortunately it freeze and newer wake up :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions