arduino / arduino/ArduinoCore-API
Should SPI `attachInterrupt()` and `detachInterrupt()` be removed?
- 主要言語
- C++
- スター
- 306
- フォーク
- 150
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
It looks like these methos are only used in the AVR ports, and even then they indicate that they should not be used.
[ArduinoCore-avr/libraries/SPI/src/SPI.h#L306-L310](https://github.com/arduino/ArduinoCore-avr/blob/42fa4a1ea1b1b11d1cc0a60298e529d37f9d14bd/libraries/SPI/src/SPI.h#L306-L310)
[ArduinoCore-megaavr/libraries/SPI/src/SPI.h#L183-L187](https://github.com/arduino/ArduinoCore-megaavr/blob/01b56951ed2a8acfa7a4efc4e9a2687f626641d1/libraries/SPI/src/SPI.h#L183-L187)
```cpp
// These undocumented functions should not be used. SPI.transfer()
// polls the hardware flag which is automatically cleared as the
// AVR responds to SPI's interrupt
inline static void attachInterrupt() { SPCR |= _BV(SPIE); }
inline static void detachInterrupt() { SPCR &= ~_BV(SPIE); }
```
Other cores do nothing or even do not implement it:
- [ArduinoCore-samd/libraries/SPI/SPI.cpp#L267-L273](https://github.com/arduino/ArduinoCore-samd/blob/26f2d480e1f8934c8e225f4171076e2e3be0a949/libraries/SPI/SPI.cpp#L267-L273)
- [ArduinoCore-mbed/libraries/SPI/SPI.cpp#L90-L96](https://github.com/arduino/ArduinoCore-mbed/blob/8593ab99713c662060cd02ca95c3ef25b2fd1bce/libraries/SPI/SPI.cpp#L90-L96)
- [ArduinoCore-arc32/libraries/SPI/src/SPI.h](https://github.com/arduino/ArduinoCore-arc32/blob/9f2e5e1404649026c057a4128308cb20c413b021/libraries/SPI/src/SPI.h)
- [ArduinoCore-sam/libraries/SPI/src/SPI.cpp](https://github.com/arduino/ArduinoCore-sam/blob/790ff2c852bf159787a9966bddee4d9f55352d15/libraries/SPI/src/SPI.cpp)
When are these methods meant to be used by Arduino users or ArduinoCore developers?
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
ArduinoCore-avr、megaavr、samd、mbed、arc32、sam にリンクされている SPI の宣言と実装を比較します。まず、これらの core で attachInterrupt() と detachInterrupt() がどのように定義または省略されているか、また API の契約でそれらの目的が説明されているかを確認します。対応状況について文書化された判断に到達し、影響を受ける core ファイルを特定できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- api, embedded-iot
- issue の種類
- リファクタリング
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 30/100