Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Commit 5fa93be

Browse files
chiararuggerisergiotomasello
chiararuggeri
authored andcommitted
Added Nordic delay in STM32 functions in order to use them in interrupt handler routines
1 parent ccfe57f commit 5fa93be

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cores/arduino/wiring_digital.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ void pinMode( uint32_t ulPin, uint32_t ulMode )
232232

233233
if ( (ulPin == 34) && (ulMode == STM32_IT) )
234234
{
235-
delay(15);
235+
nrf_delay_ms(15);
236236
TwoWire_begin();
237237
TwoWire_beginTransmission(0x48);
238238
TwoWire_write(GPIO_USER1_IT);
@@ -278,7 +278,7 @@ void digitalWrite( uint32_t ulPin, uint32_t ulVal )
278278
switch ( ulPin )
279279
{
280280
case 38:
281-
delay(15);
281+
nrf_delay_ms(15);
282282
if(ulVal == HIGH)
283283
{
284284
TwoWire_begin();
@@ -296,7 +296,7 @@ void digitalWrite( uint32_t ulPin, uint32_t ulVal )
296296
break ;
297297

298298
case 39:
299-
delay(15);
299+
nrf_delay_ms(15);
300300
if(ulVal == HIGH)
301301
{
302302
TwoWire_begin();
@@ -314,7 +314,7 @@ void digitalWrite( uint32_t ulPin, uint32_t ulVal )
314314
break ;
315315

316316
case 40:
317-
delay(15);
317+
nrf_delay_ms(15);
318318
if(ulVal == HIGH)
319319
{
320320
TwoWire_begin();
@@ -332,7 +332,7 @@ void digitalWrite( uint32_t ulPin, uint32_t ulVal )
332332
break ;
333333

334334
case 41:
335-
delay(15);
335+
nrf_delay_ms(15);
336336
if(ulVal == HIGH)
337337
{
338338
TwoWire_begin();
@@ -350,7 +350,7 @@ void digitalWrite( uint32_t ulPin, uint32_t ulVal )
350350
break ;
351351

352352
case 42:
353-
delay(15);
353+
nrf_delay_ms(15);
354354
if(ulVal == HIGH)
355355
{
356356
TwoWire_begin();
@@ -396,12 +396,12 @@ int digitalRead( uint32_t ulPin )
396396
switch ( ulPin )
397397
{
398398
case 44:
399-
delay(15);
399+
nrf_delay_ms(15);
400400
TwoWire_begin();
401401
TwoWire_beginTransmission(0x48);
402402
TwoWire_write(USER2_BUTTON_IN);
403403
TwoWire_endTransmission();
404-
delay(15);
404+
nrf_delay_ms(15);
405405
TwoWire_requestFrom(0x48, 2, true);
406406
char c = TwoWire_read();
407407
if (c == 0xC3)

0 commit comments

Comments
 (0)