Skip to content

fixing beginTransaction() thread safety #6425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
May 9, 2022
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
534978d
fixing beginTransaction() thread safety
smarq8 Mar 13, 2022
957f818
fixing beginTransaction thread safety
smarq8 Mar 13, 2022
db409b9
fixing beginTransaction()
smarq8 Mar 13, 2022
3480fa9
Merge branch 'master' into master
smarq8 Mar 13, 2022
7c2d808
fixing beginTransaction() by protecting _freq and _div by additional …
smarq8 Mar 14, 2022
5f4bc38
Update esp32-hal-spi.h
smarq8 Mar 14, 2022
70431bb
Update SPI.cpp
smarq8 Mar 14, 2022
5b2e387
add missing code
smarq8 Mar 14, 2022
8be51a4
ensure to lock params for whole transaction
smarq8 Mar 14, 2022
41be2fc
fix incorrect mutex macro at spiSimpleTransaction
smarq8 Mar 29, 2022
2d1098f
added paramLock destructor
smarq8 Mar 29, 2022
15fcc21
move create/delete to contructor/destructor
smarq8 Mar 29, 2022
28943f4
moving paramLock' delete from end() to destructor
smarq8 Mar 29, 2022
5a30b8a
.
smarq8 Mar 29, 2022
262a000
Merge branch 'master' of https://github.com/smarq8/arduino-esp32
smarq8 Mar 29, 2022
eaca28f
paramLock assign to null
smarq8 Mar 29, 2022
d0cc215
Merge branch 'master' of https://github.com/smarq8/arduino-esp32
smarq8 Mar 29, 2022
cf1363a
fix type typo and include files
smarq8 Mar 29, 2022
3e42a87
added paramLock initializer
smarq8 Mar 29, 2022
b4a6329
fix type typo
smarq8 Mar 29, 2022
22e2881
missing include for log_e
smarq8 Mar 29, 2022
64cb9c8
fix destructor declaration
smarq8 Mar 29, 2022
d157e52
missing paranthases
smarq8 Mar 29, 2022
beda8cd
missing paranthases
smarq8 Mar 29, 2022
a4950f2
Merge branch 'dev1' of https://github.com/smarq8/arduino-esp32 into dev1
smarq8 Mar 29, 2022
e91e10a
Merge branch 'master' into master
me-no-dev May 4, 2022
1b3c34a
Fix indentation
me-no-dev May 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
.
  • Loading branch information
smarq8 committed Mar 29, 2022
commit 5a30b8a32d44569e25ab65d539765dacdd955090
10 changes: 5 additions & 5 deletions libraries/SPI/src/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ SPIClass::SPIClass(uint8_t spi_bus)
SPIClass::~SPIClass()
{
end();
#if !CONFIG_DISABLE_HAL_LOCKS
if(paramLock!=NULL){
vSemaphoreDelete(paramLock);
}
#endif
}

void SPIClass::begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
Expand Down Expand Up @@ -111,11 +116,6 @@ void SPIClass::end()
spiDetachMOSI(_spi, _mosi);
setHwCs(false);
spiStopBus(_spi);
#if !CONFIG_DISABLE_HAL_LOCKS
if(paramLock!=NULL){ // not sure if that statement is mandatory
vSemaphoreDelete(paramLock);
}
#endif
_spi = NULL;
}

Expand Down