Skip to content

Commit

Permalink
Only enable on relevant controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
keirlawson committed Nov 28, 2023
1 parent 0991b1a commit cba54d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ use esp_idf_sys::{
touch_pad_t_TOUCH_PAD_NUM8, touch_pad_t_TOUCH_PAD_NUM9, EspError,
};

#[cfg(any(esp32, esp32s2, esp32s3))]
pub enum FsmMode {
Timer,
SW,
Max,
}

#[cfg(any(esp32, esp32s2, esp32s3))]
impl From<FsmMode> for touch_fsm_mode_t {
fn from(value: FsmMode) -> Self {
match value {
Expand All @@ -25,6 +27,7 @@ impl From<FsmMode> for touch_fsm_mode_t {
}
}

#[cfg(any(esp32, esp32s2, esp32s3))]
pub enum TouchPad {
Pad0,
Pad1,
Expand All @@ -43,6 +46,7 @@ pub enum TouchPad {
Pad14,
}

#[cfg(any(esp32, esp32s2, esp32s3))]
impl From<TouchPad> for touch_pad_t {
fn from(value: TouchPad) -> Self {
match value {
Expand All @@ -65,8 +69,10 @@ impl From<TouchPad> for touch_pad_t {
}
}

#[cfg(any(esp32, esp32s2, esp32s3))]
pub struct TouchDriver {}

#[cfg(any(esp32, esp32s2, esp32s3))]
impl TouchDriver {
pub fn new() -> Result<Self, EspError> {
Ok(TouchDriver {})
Expand Down

0 comments on commit cba54d1

Please sign in to comment.