Skip to content

Commit a094316

Browse files
committed
Minor fixes
1 parent c238161 commit a094316

File tree

5 files changed

+21
-26
lines changed

5 files changed

+21
-26
lines changed

boards.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ Generic_nRF52840.build.board=GENERIC
342342
Generic_nRF52840.build.core=nRF5
343343
Generic_nRF52840.build.variant=Generic_nRF52840
344344
Generic_nRF52840.build.variant_system_lib=
345-
#TODO: убрать отладку
346-
Generic_nRF52840.build.extra_flags=-DNRF52 -gdwarf-2
345+
Generic_nRF52840.build.extra_flags=-DNRF52
347346
Generic_nRF52840.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
348347
Generic_nRF52840.build.ldscript=nrf52840.ld
349348

cores/nRF5/Arduino.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -92,38 +92,17 @@ void loop( void ) ;
9292

9393
#define bit(b) (1UL << (b))
9494

95-
//TODO: Проверить
9695
#ifdef NRF_P1
9796
#define digitalPinToPort(P) ( (g_ADigitalPinMap[P] < 32) ? NRF_P0 : NRF_P1 )
9897
#else
9998
#define digitalPinToPort(P) ( NRF_P0 )
10099
#endif
101100

102101
//#define digitalPinToPort(P) ( &(NRF_GPIO[P]) )
103-
//TODO: Проверить
102+
104103
#define digitalPinToBitMask(P) ( 1UL << ( g_ADigitalPinMap[P] < 32 ? g_ADigitalPinMap[P] : (g_ADigitalPinMap[P]-32) ) )
105104
//#define digitalPinToBitMask(P) ( 1 << g_ADigitalPinMap[P] )
106105

107-
__STATIC_INLINE NRF_GPIO_Type * nrf_gpio_pin_port_decode(uint32_t * p_pin)
108-
{
109-
//NRFX_ASSERT(*p_pin < NUMBER_OF_PINS);
110-
#if (GPIO_COUNT == 2)
111-
//if (*p_pin < P0_PIN_NUM)
112-
if (*p_pin < 32)
113-
{
114-
return NRF_P0;
115-
}
116-
else
117-
{
118-
*p_pin = *p_pin & (32 - 1);
119-
return NRF_P1;
120-
}
121-
#else
122-
// The oldest definition case
123-
return NRF_GPIO;
124-
#endif
125-
}
126-
127106
//#define analogInPinToBit(P) ( )
128107
#define portOutputRegister(port) ( &(port->OUTSET) )
129108
#define portInputRegister(port) ( &(port->IN) )

cores/nRF5/SDK/components/device/nrf51_to_nrf52.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878

7979
/* GPIO */
8080
/* GPIO port was renamed to P0. */
81-
//TODO: Разобраться
8281
#define NRF_GPIO NRF_P0
8382
#define NRF_GPIO_BASE NRF_P0_BASE
8483

cores/nRF5/wiring.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ extern "C" {
2424

2525
extern void init(void);
2626

27+
__STATIC_INLINE NRF_GPIO_Type * nrf_gpio_pin_port_decode(uint32_t * p_pin)
28+
{
29+
#if (GPIO_COUNT == 2)
30+
//if (*p_pin < P0_PIN_NUM)
31+
if (*p_pin < 32)
32+
{
33+
return NRF_P0;
34+
}
35+
else
36+
{
37+
*p_pin = *p_pin & (32 - 1);
38+
return NRF_P1;
39+
}
40+
#else
41+
// The oldest definition case
42+
return NRF_GPIO;
43+
#endif
44+
}
45+
2746
#ifdef __cplusplus
2847
}
2948
#endif

variants/Generic_nRF52840/variant.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ static const uint8_t SCK = PIN_SPI_SCK ;
9393
/*
9494
* Wire Interfaces
9595
*/
96-
//TODO: Определиться позднее
9796
#define WIRE_INTERFACES_COUNT 1
9897

9998
#define PIN_WIRE_SDA (20u) // P0.20

0 commit comments

Comments
 (0)