mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
SRF02 driver, new handling of failed sensor initialization.
This commit is contained in:
parent
f61785de06
commit
c7d35903e1
@ -16,9 +16,9 @@
|
||||
*
|
||||
* @author Freie Universität Berlin, Computer Systems & Telematics
|
||||
* @author Zakaria Kasmi <zkasmi@inf.fu-berlin.de>
|
||||
* @version $Revision: 3854 $
|
||||
* @version $Revision: 3855 $
|
||||
*
|
||||
* @note $Id: srf02-ultrasonic-sensor.c 3857 2013-09-03 15:50:13 kasmi $
|
||||
* @note $Id: srf02-ultrasonic-sensor.c 3857 2013-09-04 14:05:41 kasmi $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -37,10 +37,8 @@ bool srf02_init(uint8_t i2c_interface, uint32_t baud_rate)
|
||||
{
|
||||
if (i2c_initialize(i2c_interface, (uint32_t) I2CMASTER, 0, baud_rate, NULL)
|
||||
== false) { /* initialize I2C */
|
||||
puts("fatal error!happened in i2cInitialize() \n");
|
||||
|
||||
while (1)
|
||||
; /* Fatal error */
|
||||
puts("fatal error happened in i2c_initialize()\n");
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
i2c_enable_pull_up_resistor(i2c_interface);
|
||||
|
Loading…
Reference in New Issue
Block a user