17 new posts / 0
The Last post
songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
Wake up key problem

Functional requirements:
Multiple pins can wake up the system..
Problem description:
I see the app push button, his wkupct_enable_irq can only use a pin?I have more than one pin to wakeup. How?

Device:
Gongyu_Dialog
Offline
Last seen:35 min line 22 hours
Joined:The 2016-04-27 07:07
Suggest you take a look at the mouse demo project.

Suggest you take a look at the mouse demo project.

Void app_kbd_enable_wakeup_irq (void)
{
/ / P10 (MOT), P11 (BL), P07 (BM), P01 (BR)
Const uint32_t sel_pins = ((1 < < 7) | | (1 < < 1)) (((1 < < 1) | (1 < < < < 0)));/ / support several road GPIO do wake up
Const uint32_t pol_pins = ((!Middle_button_pressed < < 7) | (!Right_button_pressed | < < 1)) (((!Left_button_pressed < < 1) | (1 < < < < 0)));

Wkupct_register_callback (wakeup_handler);/ / TODO: No need to be called always, only once during appl. Initialization.

Wkupct_enable_irq (sel_pins pol_pins, WAKEUP_EVENTS_QUOTA WAKEUP_KEY_DEBOUNCING_TIME_IN_MS);
}

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
I tried this way. But no, oh

I tried this way. But no, oh
Wkupct_enable_irq (WKUPCT_PIN_SELECT (GPIO_BUTTON_PORT GPIO_BUTTON_PIN)
| WKUPCT_PIN_SELECT (GPIO_DISMANTLE_CHECK2_PORT GPIO_DISMANTLE_CHECK2_PIN)
, / / the select pin (GPIO_BUTTON_PORT GPIO_BUTTON_PIN)

WKUPCT_PIN_POLARITY (GPIO_BUTTON_PORT GPIO_BUTTON_PIN, WKUPCT_PIN_POLARITY_HIGH)
| WKUPCT_PIN_POLARITY (GPIO_DISMANTLE_CHECK2_PORT GPIO_DISMANTLE_CHECK2_PIN, WKUPCT_PIN_POLARITY_HIGH)
, / / polarity high
1, / / 1 event
0 x30);/ / debouncing time = 0

}

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
The mouse demo project is not sdk5.0.3 and 5.0

The mouse in the demo project is not sdk5.0.3 and 5.0.4 ah

Gongyu_Dialog
Offline
Last seen:35 min line 22 hours
Joined:The 2016-04-27 07:07
The mouse is a separate project, can be in the reference

The mouse is a separate project, can be in the reference for the design.You are not now press a single key, changes don't wake up?

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
If separate set a button, the button is no problem,

If separate set a button, the button is no problem, but on or other one key, has led to two buttons are no wakeup system function!

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
Have you tried?Why not on my side?

Have you tried?Why not on my side?I use is 5.0.3 prox_reporter directly in engineering user_proxr. C he turned out a button. I think he keys or structure, so I added a button. After added, the original button can't wake up the system. My system is ARCH_EXT_SLEEP_ON sleep patterns.
And I see him in user_periph_setup. H defines WKUP_ENABLED inside.

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
Someone to echo the?Online etc.

Someone to echo the?Online etc.

Gongyu_Dialog
Offline
Last seen:35 min line 22 hours
Joined:The 2016-04-27 07:07
I can here, add a button2, then in the app

I can here, add a button2, then in app_button_press_cb print information

Void app_button_enable (void)
{
App_easy_wakeup_set (app_wakeup_cb);
Wkupct_register_callback (app_button_press_cb);
# if USE_PUSH_BUTTON
If (GPIO_GetPinStatus (GPIO_BUTTON_PORT GPIO_BUTTON_PIN))
Wkupct_enable_irq (WKUPCT_PIN_SELECT (GPIO_BUTTON_PORT GPIO_BUTTON_PIN) | WKUPCT_PIN_SELECT (GPIO_BUTTON2_PORT, GPIO_BUTTON2_PIN), / / select pin (GPIO_BUTTON_PORT GPIO_BUTTON_PIN)
WKUPCT_PIN_POLARITY (GPIO_BUTTON_PORT GPIO_BUTTON_PIN, WKUPCT_PIN_POLARITY_LOW) | WKUPCT_PIN_POLARITY (GPIO_BUTTON2_PORT GPIO_BUTTON2_PIN, WKUPCT_PIN_POLARITY_LOW), / / polarity is low
1, / / 1 event
0);/ / debouncing time = 0
# endif
}

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
Now that you can print the information that you are in a deep sleep state.

Now that you can print the information that you are in a deep sleep state. Please try to under ARCH_EXT_SLEEP_ON condition test to confirm it. Thank you.
And I found that in ARCH_EXT_SLEEP_ON after wake up, a little bit other strange phenomenon. This regardless. Later I ask.

Gongyu_Dialog
Offline
Last seen:35 min line 22 hours
Joined:The 2016-04-27 07:07
Is a const static sleep_state

Is a const static sleep_state_t app_default_sleep_mode = ARCH_EXT_SLEEP_ON;

I am on a peripheral electric up printing.

Void app_button_press_cb (void)
{
...
If (GetBits16 (SYS_STAT_REG PER_IS_DOWN))
Periph_init ();

Printf_string (" hello \ n ");/ / /
}

Void uart_send_byte (char ch)
{
While ((GetWord16 (UART_LSR_REG) & 0 x20) = = 0)./ / read the status reg to check if THR is empty
SetWord16 (UART_RBR_THR_DLL_REG, (0 XFF & ch));/ / write to THR register
}

Void printf_string STR (char *)
{
While (* STR!= '\ 0')
{/ / while not reach the last string character
Uart_send_byte (* STR);/ / send next string character
Str++;
}
}

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
Thank you. Tomorrow I put your application code to look on my system.

Thank you. Tomorrow I put your application code to look on my system.
Because I wake up, it is my oled screen lit up. Perhaps light failure. Because when I found that a single button, normal should screen out again after wake up 3 s screen, but the actual test, found to be illuminated after, immediately went out.
Tomorrow go to work to test and see.

And I want to ask, you put more energy on the sdk5.0.4?Because I see released on August 8th sdk5.0.4. I now have 5.0.3.

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
Hello. I according to what you said,

Hello. I according to what you said,
In the first, in user_perph_setup. C set_pad_functions () function to initialize serial port:
GPIO_ConfigurePin (UART_GPIO_PORT UART_TX_PIN, OUTPUT, PID_UART1_TX, false);
GPIO_ConfigurePin (UART_GPIO_PORT UART_RX_PIN, INPUT, PID_UART1_RX, false);
SetBits16 (CLK_PER_REG UART1_ENABLE, 1);/ / enable clock for UART 1
Uart_init (UART_BAUDRATE UART_DATALENGTH);

Then in app_button_press_cb add print. But I am in arch_main. C block
/ / arch_turn_peripherals_off (sleep_mode);
Otherwise can't print it out.

Also found that sometimes to print out the code.
[11:56:56 2016-08-19:454)?
[11:56:56 2016-08-19:712)?!!!!!!!!!Q Mi a)?> 醕 lose

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
Print the code, is a time when I program control abnormal.

Print the code, is a time when I program control abnormal.
I use a timer to time automatically shut off the screen. When it is bright screen 3 s normal, automatically shut down. But when abnormal, after his bright screen, destroy the screen immediately. I see from the print log, this is he invoked the timing of the handler.
[the 2016-08-19 14:15:23:071] 鰴?憽 Q
【 14:15:23 2016-08-19:329)?!!!!!!!!!Q Mi a)?︷ close

[the 2016-08-19 14:15:23:538] hand

But he is a sudden call. It's not normal in accordance with the time after

songsayit
Offline
Last seen:3 years 9 have a line
Joined:The 2016-05-31"
If not in app_button_press_cb ()

If not in app_button_press_cb () call spent more time function.
Get him on my side to app_wakeup_cb test again to see () function.

Gongyu_Dialog
Offline
Last seen:35 min line 22 hours
Joined:The 2016-04-27 07:07
SDK5.0.4 just released, so also in the familiar stage

SDK5.0.4 just released, so also in the familiar stage

Gongyu_Dialog
Offline
Last seen:35 min line 22 hours
Joined:The 2016-04-27 07:07
Print the code does occur, because just in wake state, 16 m is not stable.

Print the code does occur, because just in wake state, 16 m is not stable.
But you say this kind of situation will not appear.
"
Then in app_button_press_cb add print. But I am in arch_main. C block
/ / arch_turn_peripherals_off (sleep_mode);
Otherwise can't print it out.
"