HAL_Linux: give error msg on failure to start toneAlarm

This commit is contained in:
Andrew Tridgell 2014-11-15 16:58:58 +11:00
parent 7718be81cb
commit c8c822422a

View File

@ -61,6 +61,7 @@ int8_t LinuxUtil::toneAlarm_init()
{
tune_num = 0; //play startup tune
if((period_fd == -1) || (duty_fd == -1) || (run_fd == -1)){
hal.console->printf("ToneAlarm: Error!! please check if PWM overlays are loaded correctly");
return -1;
}
return 0;
@ -68,7 +69,6 @@ int8_t LinuxUtil::toneAlarm_init()
void LinuxUtil::stop()
{
write(run_fd,"0",sizeof(char));
}