Skip to content

Commit 2d94112

Browse files
committed
Fix some uncaught exception
1 parent 4fdc71c commit 2d94112

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

LSA08_Simplified.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ unsigned int LSA08::read_line()
117117
{
118118
return analogRead(pin);
119119
}
120+
else
121+
return 0;
120122
}
121123

122124
unsigned char LSA08::send_packet(unsigned char command, unsigned char value, com_type type)
@@ -178,4 +180,8 @@ unsigned char LSA08::get_response(com_type type)
178180
return BAD_PACKET;
179181
}
180182
}
183+
else
184+
{
185+
return 0;
186+
}
181187
}

0 commit comments

Comments
 (0)