Part Number: TDA2E
Tool/software:
Case A:
// config GPIO_1 to output mode
GPIODirModeSet(gpio_1, GPIO_DIR_OUTPUT);
// set GPIO_1 to HIGH
GPIOPinWrite(gpio_1, GPIO_PIN_HIGH)
// The high level duration here is 350ms by The oscilloscope.
// It is inconsistent with the 100ms defined in the software.
BspOsal_sleep(100U);
// set GPIO_1 to LOW
GPIOPinWrite(gpio_1, GPIO_PIN_LOW)
// The Low level duration here is 150ms by The oscilloscope.
// It is inconsistent with the 50ms defined in the software.
BspOsal_sleep(50U);
// set GPIO_1 to HIGH
GPIOPinWrite(gpio_1, GPIO_PIN_HIGH)
Case B:
// sleep 1500ms
BspOsal_sleep(1500U);
// config GPIO_1 to output mode
GPIODirModeSet(gpio_1, GPIO_DIR_OUTPUT);
// set GPIO_1 to HIGH
GPIOPinWrite(gpio_1, GPIO_PIN_HIGH)
// The high level duration here is 100ms by The oscilloscope.
BspOsal_sleep(100U);
// set GPIO_1 to LOW
GPIOPinWrite(gpio_1, GPIO_PIN_LOW)
// The Low level duration here is 50ms by The oscilloscope.
BspOsal_sleep(50U);
// set GPIO_1 to HIGH
GPIOPinWrite(gpio_1, GPIO_PIN_HIGH)
How can the sleep time be made as accurate as possible without introducing redundant waiting time?