Revision 232ccea6

View differences:

periphery-lld/AMiRo-LLD
1
Subproject commit 9466e34d0601c3e9e7c0627a1bf5d8e88bf40a92
1
Subproject commit a5507edc6e69616a793494b332121a60ad8af7f9
periphery-lld/periphAL.h
64 64
 *
65 65
 * @param[in] c     The condition to check.
66 66
 */
67
#define apalDbgAssert(c)                                                      \
68
  _apalDbgAssertMsg(c, "%s(%u): apalDbgAssert failed", __FILE__, __LINE__);
67
#define apalDbgAssert(c) _apalDbgAssertMsg(c, "%s(%u): apalDbgAssert failed", __FILE__, __LINE__)
68

  
69 69

  
70 70
#else /* (AMIROOS_CFG_DBG != true) */
71 71

  
......
84 84
 *
85 85
 * @param[in]   us    Time to sleep until execution continues in microseconds.
86 86
 */
87
static inline void usleep(apalTime_t us)
87
static inline void apalSleep(apalTime_t us)
88 88
{
89 89
  // check if the specified time can be represented by the system
90 90
  apalDbgAssert(us <= chTimeI2US(TIME_INFINITE));
......
165 165
}
166 166

  
167 167
/**
168
 * @brief Return the interrupt enable status of the GPIO.
169
 *
170
 * @param[in]   gpio      GPIO to check.
171
 * @param[out]  enabled   Flag, indicating whether interrupt is enabled for the GPIO.
172
 *
173
 * @return The status indicates whether the function call was successful.
174
 */
175
static inline apalExitStatus_t apalGpioIsInterruptEnabled(apalGpio_t* gpio, bool* const enabled)
176
{
177
  apalDbgAssert(gpio != NULL);
178
  apalDbgAssert(enabled != NULL);
179

  
180
  *enabled = palIsLineEventEnabledX(gpio->line);
181
  return APAL_STATUS_OK;
182
}
183

  
184
/**
168 185
 * @brief Get the current on/off state of a control GPIO.
169 186
 *
170 187
 * @param[in]   gpio  Control GPIO to read.
......
212 229
     (edge == APAL_GPIO_EDGE_BOTH) ? PAL_EVENT_MODE_BOTH_EDGES :      \
213 230
      PAL_EVENT_MODE_DISABLED)
214 231

  
232
/**
233
 * @brief Enable or disable the interrupt event functionality.
234
 *
235
 * @param[in] cgpio   Control GPIO to set.
236
 * @param[in] enable  Flag, indicating whether the interrupt shall be activated (true) or deactivated (false).
237
 *
238
 * @return The status indicates whether the function call was successful.
239
 */
240
static inline apalExitStatus_t apalControlGpioSetInterrupt(const apalControlGpio_t* const cgpio, const bool enable)
241
{
242
  apalDbgAssert(cgpio != NULL);
243
  apalDbgAssert(cgpio->gpio != NULL);
244

  
245
  if (enable) {
246
    apalDbgAssert(pal_lld_get_line_event(cgpio->gpio->line) != NULL);
247
    palEnableLineEvent(cgpio->gpio->line, APAL2CH_EDGE(cgpio->meta.edge));
248
  } else {
249
    palDisableLineEvent(cgpio->gpio->line);
250
  }
251

  
252
  return APAL_STATUS_OK;
253
}
254

  
215 255
#endif /* (HAL_USE_PAL == TRUE) */
216 256

  
217 257
/*============================================================================*/
test/periphery-lld/AT42QT1050_v1/aos_test_AT42QT1050.c
312 312
    //wait for calibration to complete
313 313
    error = true;
314 314
    for(uint8_t i=0; i<0xFF; i++) {
315
        usleep(10);
315
        aosThdUSleep(10);
316 316
        status |= at42qt1050_lld_read_reg(((aos_test_at42qt1050data_t*)test->data)->at42qt1050d, AT42QT1050_LLD_REG_DETECTIONSTATUS, &test_8, ((aos_test_at42qt1050data_t*)test->data)->timeout);
317 317
        if(!(test_8 & AT42QT1050_LLD_DETECTIONSTATUS_CALIBRATE)) {
318 318
            error = false;

Also available in: Unified diff