Nordic are very fond of this kind of thing:
Display All
ie, renaming functions via #defines.
So, for example, in my code I might call nrf_drv_gpiote_init:
If I do either 'Go To Definition' or 'Go To Declaration' on that call, they both end up at the #define
Which is all fine and correct.
But, if I select nrfx_gpiote_in_init on that #define line, then 'Go To Declaration' will go to the definition - not the declaration:
This is WRONG!
And 'Go To Declaration' at that point does nothing.
Why is this important?
Because, as is common practice, the documentation is with the declaration - not the definition:
Display All
C Source Code
- /** @brief Macro for forwarding the new implementation. */
- #define nrf_drv_gpiote_init nrfx_gpiote_init
- /** @brief Macro for forwarding the new implementation. */
- #define nrf_drv_gpiote_is_init nrfx_gpiote_is_init
- /** @brief Macro for forwarding the new implementation. */
- #define nrf_drv_gpiote_uninit nrfx_gpiote_uninit
- /** @brief Macro for forwarding the new implementation. */
- #define nrf_drv_gpiote_out_init nrfx_gpiote_out_init
- /** @brief Macro for forwarding the new implementation. */
- #define nrf_drv_gpiote_out_uninit nrfx_gpiote_out_uninit
- /** @brief Macro for forwarding the new implementation. */
- #define nrf_drv_gpiote_out_set nrfx_gpiote_out_set
So, for example, in my code I might call nrf_drv_gpiote_init:
If I do either 'Go To Definition' or 'Go To Declaration' on that call, they both end up at the #define
But, if I select nrfx_gpiote_in_init on that #define line, then 'Go To Declaration' will go to the definition - not the declaration:
This is WRONG!
And 'Go To Declaration' at that point does nothing.
Why is this important?
Because, as is common practice, the documentation is with the declaration - not the definition:
C Source Code
- /**
- * @brief Function for initializing a GPIOTE input pin.
- * @details The input pin can act in two ways:
- * - lower accuracy but low power (high frequency clock not needed)
- * - higher accuracy (high frequency clock required)
- *
- * The initial configuration specifies which mode is used.
- * If high-accuracy mode is used, the driver attempts to allocate one
- * of the available GPIOTE channels. If no channel is
- * available, an error is returned.
- * In low accuracy mode SENSE feature is used. In this case only one active pin
- * can be detected at a time. It can be worked around by setting all of the used
- * low accuracy pins to toggle mode.
- * For more information about SENSE functionality, refer to Product Specification.
- *
- * @param[in] pin Pin.
- * @param[in] p_config Initial configuration.
- * @param[in] evt_handler User function to be called when the configured transition occurs.
- *
- * @retval NRFX_SUCCESS If initialization was successful.
- * @retval NRFX_ERROR_INVALID_STATE If the driver is not initialized or the pin is already used.
- * @retval NRFX_ERROR_NO_MEM If no GPIOTE channel is available.
- */
- nrfx_err_t nrfx_gpiote_in_init(nrfx_gpiote_pin_t pin,
- nrfx_gpiote_in_config_t const * p_config,
- nrfx_gpiote_evt_handler_t evt_handler);