Skip to content

Commit

Permalink
AP_HAL_Linux: remove superfluous linefeed from panic strings
Browse files Browse the repository at this point in the history
panic adds this within the HAL layer.
  • Loading branch information
peterbarker committed Dec 13, 2024
1 parent e6796c1 commit dc2a5e0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion libraries/AP_HAL_Linux/AnalogIn_Navio2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void AnalogSource_Navio2::set_channel(uint8_t pin)
}

if (asprintf(&channel_path, "%s/ch%d", ADC_BASE_PATH, pin) == -1) {
AP_HAL::panic("asprintf failed\n");
AP_HAL::panic("asprintf failed");
}

if (_fd >= 0) {
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_Linux/CameraSensor_Mt9v117.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ CameraSensor_Mt9v117::CameraSensor_Mt9v117(const char *device_path,
_configure_sensor_qvga();
break;
default:
AP_HAL::panic("mt9v117: unsupported resolution\n");
AP_HAL::panic("mt9v117: unsupported resolution");
break;
}

Expand Down Expand Up @@ -409,7 +409,7 @@ void CameraSensor_Mt9v117::_init_sensor()

id = _read_reg16(CHIP_ID);
if (id != MT9V117_CHIP_ID) {
AP_HAL::panic("Mt9v117: bad chip id 0x%04x\n", id);
AP_HAL::panic("Mt9v117: bad chip id 0x%04x", id);
}
_soft_reset();
_apply_patch();
Expand Down
10 changes: 5 additions & 5 deletions libraries/AP_HAL_Linux/OpticalFlow_Onboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void OpticalFlow_Onboard::init()
if (!_camerasensor->set_format(HAL_OPTFLOW_ONBOARD_SENSOR_WIDTH,
HAL_OPTFLOW_ONBOARD_SENSOR_HEIGHT,
V4L2_MBUS_FMT_UYVY8_2X8)) {
AP_HAL::panic("OpticalFlow_Onboard: couldn't set subdev fmt\n");
AP_HAL::panic("OpticalFlow_Onboard: couldn't set subdev fmt");
}
_format = V4L2_PIX_FMT_NV12;
#endif
Expand All @@ -100,7 +100,7 @@ void OpticalFlow_Onboard::init()

if (_format != V4L2_PIX_FMT_NV12 && _format != V4L2_PIX_FMT_GREY &&
_format != V4L2_PIX_FMT_YUYV) {
AP_HAL::panic("OpticalFlow_Onboard: format not supported\n");
AP_HAL::panic("OpticalFlow_Onboard: format not supported");
}

if (_width == HAL_OPTFLOW_ONBOARD_OUTPUT_WIDTH &&
Expand Down Expand Up @@ -272,7 +272,7 @@ void OpticalFlow_Onboard::_run_optflow()

convert_buffer = (uint8_t *)calloc(1, convert_buffer_size);
if (!convert_buffer) {
AP_HAL::panic("OpticalFlow_Onboard: couldn't allocate conversion buffer\n");
AP_HAL::panic("OpticalFlow_Onboard: couldn't allocate conversion buffer");
}
}

Expand All @@ -286,7 +286,7 @@ void OpticalFlow_Onboard::_run_optflow()
free(convert_buffer);
}

AP_HAL::panic("OpticalFlow_Onboard: couldn't allocate crop buffer\n");
AP_HAL::panic("OpticalFlow_Onboard: couldn't allocate crop buffer");
}
}

Expand Down Expand Up @@ -322,7 +322,7 @@ void OpticalFlow_Onboard::_run_optflow()
free(output_buffer);
}

AP_HAL::panic("OpticalFlow_Onboard: couldn't get frame\n");
AP_HAL::panic("OpticalFlow_Onboard: couldn't get frame");
}

if (_format == V4L2_PIX_FMT_YUYV) {
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_HAL_Linux/RCInput_Navio2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void RCInput_Navio2::init()
for (size_t i = 0; i < ARRAY_SIZE(channels); i++) {
channels[i] = open_channel(i);
if (channels[i] < 0) {
AP_HAL::panic("[RCInput_Navio2]: failed to open channels\n");
AP_HAL::panic("[RCInput_Navio2]: failed to open channels");
}
}
}
Expand Down Expand Up @@ -64,7 +64,7 @@ int RCInput_Navio2::open_channel(int channel)
{
char *channel_path;
if (asprintf(&channel_path, "%s/ch%d", RCIN_SYSFS_PATH, channel) == -1) {
AP_HAL::panic("[RCInput_Navio2]: not enough memory\n");
AP_HAL::panic("[RCInput_Navio2]: not enough memory");
}

int fd = ::open(channel_path, O_RDONLY|O_CLOEXEC);
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace Linux;

static void catch_sigbus(int sig)
{
AP_HAL::panic("RCOutputAioPRU.cpp:SIGBUS error generated\n");
AP_HAL::panic("RCOutputAioPRU.cpp:SIGBUS error generated");
}
void RCOutput_AioPRU::init()
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_Linux/RCOutput_PRU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static const uint8_t chan_pru_map[]= {10,8,11,9,7,6,5,4,3,2,1,0};

static void catch_sigbus(int sig)
{
AP_HAL::panic("RCOutput.cpp:SIGBUS error generated\n");
AP_HAL::panic("RCOutput.cpp:SIGBUS error generated");
}
void RCOutput_PRU::init()
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_Linux/RCOutput_ZYNQ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace Linux;

static void catch_sigbus(int sig)
{
AP_HAL::panic("RCOutput.cpp:SIGBUS error generated\n");
AP_HAL::panic("RCOutput.cpp:SIGBUS error generated");
}
void RCOutput_ZYNQ::init()
{
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_Linux/SPIUARTDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void SPIUARTDriver::_begin(uint32_t b, uint16_t rxS, uint16_t txS)
_buffer = NEW_NOTHROW uint8_t[rxS];
if (_buffer == nullptr) {
hal.console->printf("Not enough memory\n");
AP_HAL::panic("Not enough memory\n");
AP_HAL::panic("Not enough memory");
}
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_HAL_Linux/VideoIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bool VideoIn::get_frame(Frame &frame)
{
if (!_streaming) {
if (!_set_streaming(true)) {
AP_HAL::panic("couldn't start streaming\n");
AP_HAL::panic("couldn't start streaming");
return false;
}
_streaming = true;
Expand Down

0 comments on commit dc2a5e0

Please sign in to comment.