ESP32 宏定义
typedef int esp_err_t;
ESP_OK
//esp_err_t value indicating success (no error)
//表示执行成功 没有错误
ESP_FAIL
//Generic esp_err_t code indicating failure
//表示程序执行失败
ESP_ERR_NO_MEM
//Out of memory
//超出内存
ESP_ERR_INVALID_ARG
//Invalid argument
//参数不合法
ESP_ERR_INVALID_STATE
//Invalid state
//状态不合法
ESP_ERR_INVALID_SIZE
//Invalid size
//大小不合法
ESP_ERR_NOT_FOUND
//Requested resource not found
//请求资源没找到
ESP_ERR_NOT_SUPPORTED
//Operation or feature not supported
//不支持这个功能或者操作
ESP_ERR_TIMEOUT
//Operation timed out
//操作超时
ESP_ERR_INVALID_RESPONSE
//Received response was invalid
//响应不合法
ESP_ERR_INVALID_CRC
//CRC or checksum was invalid
//CRC或者checksum 校验不合法
ESP_ERR_INVALID_VERSION
//Version was invalid
//版本不合法
ESP_ERR_INVALID_MAC
//MAC address was invalid
//MAC 地址不合法
ESP_ERR_WIFI_BASE
//Starting number of WiFi error codes
ESP_ERR_MESH_BASE
//Starting number of MESH error codes
ESP_ERR_FLASH_BASE
//Starting number of flash error codes
ESP_ERR_HW_CRYPTO_BASE
//Starting number of HW cryptography module error codes
ESP_ERROR_CHECK(x)
//Macro which can be used to check the error code, and terminate the //program in case the code is not ESP_OK. Prints the error code, error //location, and the failed statement to serial output.
//
//Disabled if assertions are disabled.
//这个宏定义是个函数
//可以进行异常检测,终止程序,并打印异常信息
//参数应该是个函数,函数的返回值如果不是ESP_OK
//程序就会被中断并打印异常信息
//如果断言不可用,这个也不可用
ESP_ERROR_CHECK_WITHOUT_ABORT(x)
//Macro which can be used to check the error code. Prints the error //code, error location, and the failed statement to serial output. In //comparison with ESP_ERROR_CHECK(), this prints the same error message //but isn’t terminating the program.
//同样可以检查错误代码,但是这种方法并不会中断程序的执行,
//而只显示错误代码。