Skip to content

Commit 9e9a935

Browse files
authored
Merge pull request #268 from suda-morris/iram/rmt_rx_callback_iram
change(onewire): put callback function in iram
2 parents 0463f1c + 53b04da commit 9e9a935

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

onewire_bus/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# 1-Wire Bus Driver
1+
# Dallas 1-Wire Bus Driver
22

33
[![Component Registry](https://components.espressif.com/components/espressif/onewire_bus/badge.svg)](https://components.espressif.com/components/espressif/onewire_bus)
44

5-
This directory contains an implementation for 1-Wire bus by different peripherals. Currently only RMT is supported as the backend.
5+
This directory contains an implementation for Dallas 1-Wire bus by different peripherals. Currently only RMT is supported as the backend.

onewire_bus/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: "1.0.0"
1+
version: "1.0.1"
22
description: Driver for Dalas 1-Wire bus
33
url: https://github.com/espressif/idf-extra-components/tree/master/onewire_bus
44
issues: "https://github.com/espressif/idf-extra-components/issues"

onewire_bus/src/onewire_bus_impl_rmt.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "freertos/queue.h"
1010
#include "freertos/semphr.h"
1111
#include "esp_check.h"
12+
#include "esp_attr.h"
1213
#include "driver/rmt_tx.h"
1314
#include "driver/rmt_rx.h"
1415
#include "onewire_bus_impl_rmt.h"
@@ -124,21 +125,21 @@ typedef struct {
124125
SemaphoreHandle_t bus_mutex;
125126
} onewire_bus_rmt_obj_t;
126127

127-
const static rmt_symbol_word_t onewire_reset_pulse_symbol = {
128+
static rmt_symbol_word_t onewire_reset_pulse_symbol = {
128129
.level0 = 0,
129130
.duration0 = ONEWIRE_RESET_PULSE_DURATION,
130131
.level1 = 1,
131132
.duration1 = ONEWIRE_RESET_WAIT_DURATION
132133
};
133134

134-
const static rmt_symbol_word_t onewire_bit0_symbol = {
135+
static rmt_symbol_word_t onewire_bit0_symbol = {
135136
.level0 = 0,
136137
.duration0 = ONEWIRE_SLOT_START_DURATION + ONEWIRE_SLOT_BIT_DURATION,
137138
.level1 = 1,
138139
.duration1 = ONEWIRE_SLOT_RECOVERY_DURATION
139140
};
140141

141-
const static rmt_symbol_word_t onewire_bit1_symbol = {
142+
static rmt_symbol_word_t onewire_bit1_symbol = {
142143
.level0 = 0,
143144
.duration0 = ONEWIRE_SLOT_START_DURATION,
144145
.level1 = 1,
@@ -163,7 +164,8 @@ static esp_err_t onewire_bus_rmt_reset(onewire_bus_handle_t bus);
163164
static esp_err_t onewire_bus_rmt_del(onewire_bus_handle_t bus);
164165
static esp_err_t onewire_bus_rmt_destroy(onewire_bus_rmt_obj_t *bus_rmt);
165166

166-
static bool onewire_rmt_rx_done_callback(rmt_channel_handle_t channel, const rmt_rx_done_event_data_t *edata, void *user_data)
167+
IRAM_ATTR
168+
bool onewire_rmt_rx_done_callback(rmt_channel_handle_t channel, const rmt_rx_done_event_data_t *edata, void *user_data)
167169
{
168170
BaseType_t task_woken = pdFALSE;
169171
onewire_bus_rmt_obj_t *bus_rmt = (onewire_bus_rmt_obj_t *)user_data;
@@ -312,7 +314,7 @@ esp_err_t onewire_new_bus_rmt(const onewire_bus_config_t *bus_config, const onew
312314
ESP_GOTO_ON_ERROR(rmt_enable(bus_rmt->tx_channel), err, TAG, "enable rmt tx channel failed");
313315

314316
// release the bus by sending a special RMT symbol
315-
static const rmt_symbol_word_t release_symbol = {
317+
static rmt_symbol_word_t release_symbol = {
316318
.level0 = 1,
317319
.duration0 = 1,
318320
.level1 = 1,

0 commit comments

Comments
 (0)