This fixes uninitialised loop variables in atcmd-board, and asserts that happen too late in gpio-board.

This commit is contained in:
noshbar
2019-10-02 15:41:29 +02:00
parent 25f2aeef9e
commit b5e63d886d
2 changed files with 17 additions and 15 deletions

View File

@@ -31,7 +31,7 @@ uint8_t isspace(char x)
/*ASC<53><43>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>*/ /*ASC<53><43>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>*/
int asc2int(const uint8_t * asc, uint8_t len) int asc2int(const uint8_t * asc, uint8_t len)
{ {
uint8_t i; uint8_t i = 0;
char c; char c;
char sign; char sign;
int total = 0; int total = 0;
@@ -234,7 +234,7 @@ uint8_t at_key_handle(uint8_t *param, uint16_t size)
* AT+KEY=APPKEY, "2B7E151628AED2A6ABF7158809CF4F3C" * AT+KEY=APPKEY, "2B7E151628AED2A6ABF7158809CF4F3C"
*/ */
uint8_t key[16]; uint8_t key[16];
uint8_t i; uint8_t i = 0;
MibRequestConfirm_t mibReq; MibRequestConfirm_t mibReq;
while(param[i++] != '\"'); while(param[i++] != '\"');

View File

@@ -248,13 +248,14 @@ void GpioMcuRemoveInterrupt( Gpio_t *obj )
} }
void GpioMcuWrite( Gpio_t *obj, uint32_t value ) void GpioMcuWrite( Gpio_t *obj, uint32_t value )
{
if( obj->pin < IOE_0 )
{ {
if( obj == NULL ) if( obj == NULL )
{ {
assert_param( LORA_FAIL ); assert_param( LORA_FAIL );
} }
if( obj->pin < IOE_0 )
{
// Check if pin is not connected // Check if pin is not connected
if( obj->pin == NC ) if( obj->pin == NC )
{ {
@@ -272,14 +273,14 @@ void GpioMcuWrite( Gpio_t *obj, uint32_t value )
} }
void GpioMcuToggle( Gpio_t *obj ) void GpioMcuToggle( Gpio_t *obj )
{
if( obj->pin < IOE_0 )
{ {
if( obj == NULL ) if( obj == NULL )
{ {
assert_param( LORA_FAIL ); assert_param( LORA_FAIL );
} }
if( obj->pin < IOE_0 )
{
// Check if pin is not connected // Check if pin is not connected
if( obj->pin == NC ) if( obj->pin == NC )
{ {
@@ -297,13 +298,14 @@ void GpioMcuToggle( Gpio_t *obj )
} }
uint32_t GpioMcuRead( Gpio_t *obj ) uint32_t GpioMcuRead( Gpio_t *obj )
{
if( obj->pin < IOE_0 )
{ {
if( obj == NULL ) if( obj == NULL )
{ {
assert_param( LORA_FAIL ); assert_param( LORA_FAIL );
} }
if( obj->pin < IOE_0 )
{
// Check if pin is not connected // Check if pin is not connected
if( obj->pin == NC ) if( obj->pin == NC )
{ {