1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

fix style checking: (#7222)

- (some) core files are astyled
- ci was only checking libraries
=> now everything is checked
This commit is contained in:
david gauchard 2020-04-18 03:37:12 +02:00 committed by GitHub
parent 77b82a0c27
commit ce0e63f629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 35 deletions

View File

@ -129,9 +129,11 @@ private:
while (!timeout && !SCL_READ(twi_scl)) // outer loop is stretch duration up to stretch limit while (!timeout && !SCL_READ(twi_scl)) // outer loop is stretch duration up to stretch limit
{ {
if (yieldTimeout) // inner loop yields every 5ms if (yieldTimeout) // inner loop yields every 5ms
{
yield(); yield();
} }
} }
}
// Generate a clock "valley" (at the end of a segment, just before a repeated start) // Generate a clock "valley" (at the end of a segment, just before a repeated start)
void twi_scl_valley(void); void twi_scl_valley(void);
@ -161,21 +163,27 @@ static Twi twi;
void Twi::setClock(unsigned int freq) void Twi::setClock(unsigned int freq)
{ {
if (freq < 1000) // minimum freq 1000Hz to minimize slave timeouts and WDT resets if (freq < 1000) // minimum freq 1000Hz to minimize slave timeouts and WDT resets
{
freq = 1000; freq = 1000;
}
preferred_si2c_clock = freq; preferred_si2c_clock = freq;
#if F_CPU == FCPU80 #if F_CPU == FCPU80
if (freq > 400000) if (freq > 400000)
{
freq = 400000; freq = 400000;
}
twi_dcount = (500000000 / freq); // half-cycle period in ns twi_dcount = (500000000 / freq); // half-cycle period in ns
twi_dcount = (1000 * (twi_dcount - 1120)) / 62500; // (half cycle - overhead) / busywait loop time twi_dcount = (1000 * (twi_dcount - 1120)) / 62500; // (half cycle - overhead) / busywait loop time
#else #else
if (freq > 800000) if (freq > 800000)
{
freq = 800000; freq = 800000;
}
twi_dcount = (500000000 / freq); // half-cycle period in ns twi_dcount = (500000000 / freq); // half-cycle period in ns
twi_dcount = (1000 * (twi_dcount - 560)) / 31250; // (half cycle - overhead) / busywait loop time twi_dcount = (1000 * (twi_dcount - 560)) / 31250; // (half cycle - overhead) / busywait loop time

View File

@ -12,4 +12,4 @@ ${org}/../restyle.sh
git --version || true git --version || true
git submodule foreach --recursive 'git reset --hard' git submodule foreach --recursive 'git reset --hard'
git diff --exit-code -- $TRAVIS_BUILD_DIR/libraries git diff --exit-code -- $TRAVIS_BUILD_DIR