Decrease pmc latency

This commit is contained in:
Jeremy Soller 2020-02-24 09:45:10 -07:00
parent 130ab9d61f
commit 83c224c229
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1
3 changed files with 111 additions and 59 deletions

View File

@ -99,26 +99,43 @@ void main(void) {
uint32_t last_time = 0;
for(main_cycle = 0; ; main_cycle++) {
uint32_t time = time_get();
// Handle power states
power_event();
// Scans keyboard and sends keyboard packets
kbscan_event();
// Passes through touchpad packets
touchpad_event(&PS2_3);
// Handle lid close/open
lid_event();
// Checks for keyboard/mouse packets from host
kbc_event(&KBC);
// Only run the following once a second
if (last_time > time || (time - last_time) >= 1000) {
last_time = time;
// Updates fan status and temps
peci_event();
// Updates battery status
battery_event();
switch (main_cycle % 5) {
case 0:
// Handle power states
power_event();
break;
case 1:
// Scans keyboard and sends keyboard packets
kbscan_event();
break;
case 2:
// Passes through touchpad packets
touchpad_event(&PS2_3);
break;
case 3:
// Checks for keyboard/mouse packets from host
kbc_event(&KBC);
break;
case 4:
// Handle lid close/open
lid_event();
break;
}
if (main_cycle == 0) {
uint32_t time = time_get();
// Only run the following once a second
if (last_time > time || (time - last_time) >= 1000) {
last_time = time;
// Updates fan status and temps
peci_event();
// Updates battery status
battery_event();
}
}
// Handles ACPI communication
pmc_event(&PMC_1);
// AP/EC communication over SMFI

View File

@ -99,26 +99,43 @@ void main(void) {
uint32_t last_time = 0;
for(main_cycle = 0; ; main_cycle++) {
uint32_t time = time_get();
// Handle power states
power_event();
// Scans keyboard and sends keyboard packets
kbscan_event();
// Passes through touchpad packets
touchpad_event(&PS2_3);
// Handle lid close/open
lid_event();
// Checks for keyboard/mouse packets from host
kbc_event(&KBC);
// Only run the following once a second
if (last_time > time || (time - last_time) >= 1000) {
last_time = time;
// Updates fan status and temps
peci_event();
// Updates battery status
battery_event();
switch (main_cycle % 5) {
case 0:
// Handle power states
power_event();
break;
case 1:
// Scans keyboard and sends keyboard packets
kbscan_event();
break;
case 2:
// Passes through touchpad packets
touchpad_event(&PS2_3);
break;
case 3:
// Checks for keyboard/mouse packets from host
kbc_event(&KBC);
break;
case 4:
// Handle lid close/open
lid_event();
break;
}
if (main_cycle == 0) {
uint32_t time = time_get();
// Only run the following once a second
if (last_time > time || (time - last_time) >= 1000) {
last_time = time;
// Updates fan status and temps
peci_event();
// Updates battery status
battery_event();
}
}
// Handles ACPI communication
pmc_event(&PMC_1);
// AP/EC communication over SMFI

View File

@ -101,28 +101,46 @@ void main(void) {
uint32_t last_time = 0;
for(main_cycle = 0; ; main_cycle++) {
uint32_t time = time_get();
// Handle power states
power_event();
// Scans keyboard and sends keyboard packets
kbscan_event();
// Passes through touchpad packets
touchpad_event(&PS2_3);
// Handle lid close/open
lid_event();
// Checks for keyboard/mouse packets from host
kbc_event(&KBC);
// Only run the following once a second
if (last_time > time || (time - last_time) >= 1000) {
last_time = time;
// Updates fan status and temps
peci_event();
// Updates battery status
battery_event();
// Updates type-c port
tcpm_event();
switch (main_cycle % 5) {
case 0:
// Handle power states
power_event();
break;
case 1:
// Scans keyboard and sends keyboard packets
kbscan_event();
break;
case 2:
// Passes through touchpad packets
touchpad_event(&PS2_3);
break;
case 3:
// Checks for keyboard/mouse packets from host
kbc_event(&KBC);
break;
case 4:
// Handle lid close/open
lid_event();
break;
}
if (main_cycle == 0) {
uint32_t time = time_get();
// Only run the following once a second
if (last_time > time || (time - last_time) >= 1000) {
last_time = time;
// Updates fan status and temps
peci_event();
// Updates battery status
battery_event();
// Updates type-c port
tcpm_event();
}
}
// Handles ACPI communication
pmc_event(&PMC_1);
// AP/EC communication over SMFI