Skip to content

Commit

Permalink
Improve code consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani committed Oct 11, 2023
1 parent 39f3a79 commit c0271ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 4 additions & 5 deletions esp-wifi/src/timer_esp32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ use core::cell::RefCell;

use atomic_polyfill::{AtomicU32, Ordering};
use critical_section::Mutex;
use esp32_hal::xtensa_lx;
use esp32_hal::xtensa_lx_rt;
use esp32_hal::xtensa_lx_rt::exception::Context;
use esp32_hal::trapframe::TrapFrame;
use esp32_hal::{
interrupt,
peripherals::{self, TIMG1},
prelude::*,
timer::{Timer, Timer0},
xtensa_lx,
};

use crate::preempt::preempt::task_switch;
Expand Down Expand Up @@ -174,7 +173,7 @@ fn BT_BB() {
}

#[interrupt]
fn TG1_T0_LEVEL(context: &mut Context) {
fn TG1_T0_LEVEL(context: &mut TrapFrame) {
task_switch(context);

critical_section::with(|cs| {
Expand All @@ -189,7 +188,7 @@ fn TG1_T0_LEVEL(context: &mut Context) {

#[allow(non_snake_case)]
#[no_mangle]
fn Software1(_level: u32, context: &mut Context) {
fn Software1(_level: u32, context: &mut TrapFrame) {
let intr = 1 << 29;
unsafe {
core::arch::asm!("wsr.intclear {0}", in(reg) intr, options(nostack));
Expand Down
9 changes: 4 additions & 5 deletions esp-wifi/src/timer_esp32s2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ use core::cell::RefCell;

use atomic_polyfill::{AtomicU32, Ordering};
use critical_section::Mutex;
use esp32s2_hal::xtensa_lx;
use esp32s2_hal::xtensa_lx_rt;
use esp32s2_hal::xtensa_lx_rt::exception::Context;
use esp32s2_hal::trapframe::TrapFrame;
use esp32s2_hal::{
interrupt,
peripherals::{self, TIMG1},
prelude::*,
timer::{Timer, Timer0},
xtensa_lx,
};

use crate::preempt::preempt::task_switch;
Expand Down Expand Up @@ -123,7 +122,7 @@ fn WIFI_PWR() {
}

#[interrupt]
fn TG1_T0_LEVEL(context: &mut Context) {
fn TG1_T0_LEVEL(context: &mut TrapFrame) {
task_switch(context);

critical_section::with(|cs| {
Expand All @@ -138,7 +137,7 @@ fn TG1_T0_LEVEL(context: &mut Context) {

#[allow(non_snake_case)]
#[no_mangle]
fn Software1(_level: u32, context: &mut Context) {
fn Software1(_level: u32, context: &mut TrapFrame) {
let intr = 1 << 29;
unsafe {
core::arch::asm!("wsr.intclear {0}", in(reg) intr, options(nostack));
Expand Down

0 comments on commit c0271ae

Please sign in to comment.