Skip to content

Commit

Permalink
Merge branch 'main' into 28108_circularDMA
Browse files Browse the repository at this point in the history
  • Loading branch information
cassio-lazaro committed Jun 7, 2024
2 parents bcc572f + 6030210 commit 05e51cd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linting-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- uses: oxsecurity/megalinter/flavors/c_cpp@03986e6993ccf699a22451118520680b438e7d2a # v7.11.1
- uses: oxsecurity/megalinter/flavors/c_cpp@5199c6377b4cb7faff749a1971636f3343db9fe6 # v7.12.0
env:
APPLY_FIXES: all
VALIDATE_ALL_CODEBASE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: git diff
- uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
- uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
if: ${{ success() || failure() }}
with:
sarif_file: megalinter-reports/megalinter-report.sarif
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ jobs:
results_format: sarif
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
publish_results: true
- uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
- uses: github/codeql-action/upload-sarif@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
with:
sarif_file: scorecards.sarif
12 changes: 6 additions & 6 deletions hal_st/stm32fxxx/I2cStm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace hal
EnableClockI2c(instance);

i2cHandle.Instance = peripheralI2c[instance];
#if defined(STM32F0) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0) || defined(STM32WBA)
#if defined(I2C_TIMINGR_PRESC)
i2cHandle.Init.Timing = config.timing;
i2cHandle.Init.OwnAddress2Masks = I2C_OA2_NOMASK;
#endif
Expand Down Expand Up @@ -65,7 +65,7 @@ namespace hal

__DMB();

#if defined(STM32F0) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0) || defined(STM32WBA)
#if defined(I2C_CR1_TXIE)
peripheralI2c[instance]->CR2 = ((address.address << 1) & I2C_CR2_SADD) | (continuingPrevious ? 0 : I2C_CR2_START) | (std::min<uint32_t>(sendData.size(), 255) << 16) | (sendData.size() > 255 || nextAction == Action::continueSession ? I2C_CR2_RELOAD : 0);
peripheralI2c[instance]->CR1 |= I2C_CR1_TXIE | I2C_CR1_TCIE | I2C_CR1_NACKIE | I2C_CR1_ERRIE;
#else
Expand Down Expand Up @@ -93,7 +93,7 @@ namespace hal

__DMB();

#if defined(STM32F0) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0) || defined(STM32WBA)
#if defined(I2C_ICR_STOPCF)
peripheralI2c[instance]->ICR = I2C_ICR_STOPCF;
peripheralI2c[instance]->CR2 = ((address.address << 1) & I2C_CR2_SADD) | I2C_CR2_RD_WRN | (continuingPrevious ? 0 : I2C_CR2_START) | (std::min<uint32_t>(receiveData.size(), 255) << 16) | (receiveData.size() > 255 || nextAction == Action::continueSession ? I2C_CR2_RELOAD : 0);
peripheralI2c[instance]->CR1 |= I2C_CR1_RXIE | I2C_CR1_TCIE | I2C_CR1_NACKIE | I2C_CR1_ERRIE;
Expand Down Expand Up @@ -126,7 +126,7 @@ namespace hal

void I2cStm::EventInterrupt()
{
#if defined(STM32F0) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0) || defined(STM32WBA)
#if defined(I2C_ISR_TXE)
if ((peripheralI2c[instance]->ISR & I2C_ISR_NACKF) != 0)
{
peripheralI2c[instance]->CR1 &= ~(I2C_CR1_TXIE | I2C_CR1_RXIE | I2C_CR1_TCIE | I2C_CR1_NACKIE | I2C_CR1_ERRIE);
Expand Down Expand Up @@ -308,7 +308,7 @@ namespace hal

void I2cStm::ErrorInterrupt()
{
#if defined(STM32F0) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0) || defined(STM32WBA)
#if defined(I2C_ISR_BERR)
if ((peripheralI2c[instance]->ISR & I2C_ISR_BERR) != 0)
{
peripheralI2c[instance]->ICR |= I2C_ISR_BERR;
Expand Down Expand Up @@ -372,7 +372,7 @@ namespace hal
#endif
}

#if defined(STM32F0) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0) || defined(STM32WBA)
#if defined(I2C_ISR_TXE)
void I2cStm::ReadReceivedData()
{
while ((peripheralI2c[instance]->ISR & I2C_ISR_RXNE) != 0)
Expand Down
6 changes: 3 additions & 3 deletions hal_st/stm32fxxx/I2cStm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ namespace hal
constexpr Config()
{}

#if defined(STM32F0) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0) || defined(STM32WBA)
#if defined(I2C_TIMINGR_PRESC)
uint32_t timing = 0x00304d4d;
#endif
#if defined(STM32F2) || defined(STM32F4)
#if defined(I2C_CCR_CCR)
uint32_t clockSpeed = 400000;
#endif
};
Expand All @@ -40,7 +40,7 @@ namespace hal
private:
void EventInterrupt();
void ErrorInterrupt();
#if defined(STM32F0) || defined(STM32F7) || defined(STM32WB) || defined(STM32G4) || defined(STM32G0) || defined(STM32WBA)
#if defined(I2C_ISR_TXE)
void ReadReceivedData();
#endif

Expand Down

0 comments on commit 05e51cd

Please sign in to comment.