Wykres commitów

134 Commity (4ee17cc168b5c8e94756502fd513f2554309cdbc)

Autor SHA1 Wiadomość Data
jgromes 4ee17cc168 Debugging rework 2024-03-10 11:07:23 +01:00
Paul Lietar ab41bcac00 [CC1101] Correctly wait for packet end on blocking receive.
When using a blocking receive, I was getting non-sensical packet length
and garbage data, whereas IRQ mode was working fine. This was happening
despite what looked like a workaround for this in the code which would
read the length twice.

I tracked it down to the receive function trying to read the data too
early, before the packet had even been received. The receive function
would wait for the GDO0 pin to become low, then assume the packet was
ready and read off the data.

However, the GD0 pin is set by the `startReceive` as inverted and,
according to the datasheet, in a mode which "asserts when sync word has
been received, and de-asserts at the end of the packet". In other words,
taking into account the inversion, GDO0 becomes low at the start of the
packet and high at the end of it.

Therefore the receive function would actually try to read the packet
data as soon as the packet had started, rather than wait until the end,
explaining the garbage data.

I suspect that with a slow MCU and a fast transmission rate, the
previous workaround of reading the length field twice may have delayed
the data read just enough to allow the packet to be fully received, but
this does not work in the general case.

This commit updates the logic by first waiting for a low signal,
followed by a high one. This is actually the exact same logic used in
the blocking transmit implementation, but inverted to account for the
INV flag set on GDO0. The commit also removes the past workaround, since
it should not be necessary anymore.
2024-01-13 17:18:23 +00:00
jgromes 30961964c5 [CC1101] Cleanup private/protected members 2024-01-12 20:35:10 +01:00
jgromes 6bac59ce08 [CC1101] Fixed direct transmit (#911) 2023-12-22 15:04:19 +01:00
jgromes 0c436e5ed8 [CC1101] Reworked macro configuration system 2023-11-27 19:39:24 +01:00
jgromes 455c3c8dd0 [CC1101] Fixed crash in blocking receive (#839) 2023-11-18 15:11:10 +01:00
jgromes 49a0a1cf44 [CC1101] Added list of supported bandwidths (#842) 2023-10-09 17:40:22 +02:00
jgromes 6247cb7e85 [CC1101] Fixed garbage data (#733) 2023-08-02 22:08:52 +02:00
jgromes 72b95e5c82 [CC1101] Decreased default Rx bandwidth 2023-08-02 22:04:20 +02:00
jgromes d1e3691c32 Added notes about getPacketLength (#214) 2023-07-15 19:40:07 +02:00
jgromes a01b02fae2 [MOD] Rework for buffered SPI (#776) 2023-06-26 19:36:45 +02:00
jgromes a21fb9f136 [CC1101] Fixed direction from HAL 2023-06-21 22:13:44 +02:00
jgromes 8567c77641 [CC1101] Implemented generic actions 2023-06-21 22:07:24 +02:00
jgromes efbec6b9d1 Added custom min/max/abs macros 2023-05-16 17:13:43 +01:00
jgromes 3df9cb27ff [CC1101] Fixed non-Hal functions 2023-04-30 11:26:53 +02:00
jgromes bda6e220b6 [CC1101] Fixed variable shadowing 2023-04-23 22:03:12 +02:00
jgromes c62bb74f9d [CC1101] Fixed shadowed variable name 2023-04-23 19:40:56 +02:00
jgromes cab358ff09 [CC1101] Fixed axtra brace 2023-04-23 09:57:50 +02:00
jgromes 5c6628b6eb [CC1101] General reformatting 2023-04-23 09:47:42 +02:00
Mestery f20cc978a7 update interrupt action mode type 2023-04-16 21:45:39 +02:00
Mestery 9a68a3c901 use uint32 instead of uint8 for pin type 2023-04-16 21:39:00 +02:00
Mestery ec3d4eaf20 Improve hardware abstraction layer 2023-04-12 23:16:18 +02:00
Mestery 220b4dad7f
use printf in both build 2023-04-10 09:13:58 +00:00
Mestery 67e4dd4815
fix delayMicroseconds 2023-04-10 09:13:58 +00:00
Mestery 2a45f71384
fix undef digitalread 2023-04-10 09:13:57 +00:00
jgromes cdbb827091 [CC1101] Removed references to Arduino SPI callbacks (#725) 2023-04-10 09:06:08 +02:00
jgromes 87c1d04b42 [CC1101] Added PHY startReceive (#700) 2023-03-26 22:17:55 +02:00
jgromes 482b962f79 [CC1101] Added missing standby overload 2023-03-12 15:03:16 +01:00
jgromes 5b96340332 [CC1101] Fixed setPromiscuousMode(true) always failing 2023-01-14 23:20:27 +01:00
Matthijs Kooijman 52ec165643 Update radios to use new setRfSwitchState
This removes the compatibility wrapper and applies the following
replacements:

    sed -i 's/setRfSwitchState(LOW, LOW)/setRfSwitchState(Module::MODE_IDLE)/' src/modules/*/*.cpp
    sed -i 's/setRfSwitchState(HIGH, LOW)/setRfSwitchState(Module::MODE_RX)/' src/modules/*/*.cpp
    sed -i 's/setRfSwitchState(LOW, HIGH)/setRfSwitchState(Module::MODE_TX)/' src/modules/*/*.cpp
2023-01-09 10:26:28 +01:00
Matthijs Kooijman 3779faf600 Add setRfSwitchTable() wrapper methods
This gives all radios that use an rfswitch (i.e. have
a setRfSwitchPins() wrapper already) a wrapper method for
setRfSwitchTable() too. This wrapper just calls the same method on
Module, to make it easier for sketches to use it.
2023-01-09 10:26:27 +01:00
Matthijs Kooijman 90b28d7722 Remove duplicated setRfSwitchPins documentation
All radios that support RfSwitch define this method that simply forwards
to the `Module::setRfSwitchPins()` method. Previously, all these methods
duplicated the documentation as well, but this uses the doxygen \copydoc
to remove this duplication.
2023-01-09 09:46:31 +01:00
Federico Maggi 09669eeb26
[CC1101] Fix `setPromiscuousMode(false)` bug
Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-12-01 13:32:47 +01:00
Federico Maggi 9422723bb7
[CC1101] Validate freq-dev unless special value 0
Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-11-27 10:20:29 +01:00
Federico Maggi befba28629
No bound checks on frequency deviation if ~FSK 2022-11-26 19:38:36 +01:00
Federico Maggi 05217c095b
- Defined new RADIOLIB_ERR_NULL_POINTER
- all `begin()` now use macros for init values
- addressed other styling comments as per PR#612 review

Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-11-21 09:09:56 +01:00
Federico Maggi 1322796542
[RF69 & CC1101] Reworked cached parameters into getters
Signed-off-by: Federico Maggi <federico.maggi@gmail.com>
2022-11-20 01:35:08 +01:00
jgromes 6eeee45968 [CC1101] Use GDO2 for transmit interrupt (#357) 2022-10-09 19:21:39 +02:00
jgromes ae64ec1911 [CC1101] Fixed incorrect GPIO NC check logic 2022-10-09 19:14:07 +02:00
jgromes 9dff4e709e [CC1101] Added finishTransmit 2022-09-18 16:12:03 +02:00
jgromes da0993a6ed Added RADIOLIB_EXCLUDE_DIRECT_RECEIVE exclusion macro (#557) 2022-08-15 19:19:59 +02:00
Jan Gromeš 80950a1c22
Merge pull request #546 from NorthernMan54/master
Tweaks for async direct mode usage with rtl_433_ESP
2022-07-17 10:12:41 +02:00
Northern Man a74c0536b8 Tweaks for async direct mode usage with rtl_433_ESP 2022-07-16 21:50:33 -04:00
obones e1412108c1 Implement setDIOMapping for CC1101 2022-07-07 15:36:26 +02:00
Jan Gromeš 9b392e349e
[CC1101] Fixed incorrect parameter documentation (#523) 2022-05-23 13:46:36 +02:00
jgromes 206d49f802 [CC1101] Fixed Tx buffer flushed on Rx timeout (#520) 2022-05-17 17:31:51 +02:00
jgromes 3a55ad92e1 [CC1101] Fixed RSSI/LQI always returning incorrect values (#504) 2022-04-02 19:20:28 +02:00
James Smith e20058c93c
[CC1101] Data shaping and encoding params in right order
For some reason, the `RADIOLIB_SHAPING_NONE` was being passed to `setEncoding` and `RADIOLIB_ENCODING_NRZ` was being passed to `setDataShaping`. Flipped these to be passed to the correct functions.

Note: These are both defined as `0x00` so this should have no impact on functionality, just makes initialization less confusing.
2022-03-24 10:30:45 -07:00
jgromes 9117c61254 [CC1101] Fixed incorrect fabs brackets (#490) 2022-03-09 22:18:46 +01:00
OBones 1418470038 Use protected overloads that accept the sync mode to avoid code duplication 2022-03-04 09:45:14 +01:00