cpplint: add filter `whitespace/tab` (#29588)

old-commit-hash: 9c7bf50703
beeps
Dean Lee 2 years ago committed by GitHub
parent 2b38b62afe
commit 228d30d5a9
  1. 2
      .pre-commit-config.yaml
  2. 4
      common/mat.h
  3. 2
      selfdrive/modeld/runners/onnxmodel.h
  4. 6
      selfdrive/modeld/tests/tf_test/main.cc
  5. 28
      system/camerad/cameras/camera_qcom2.cc
  6. 20
      system/sensord/sensors/bmx055_magn.cc

@ -64,7 +64,7 @@ repos:
- --linelength=240 - --linelength=240
# https://google.github.io/styleguide/cppguide.html # https://google.github.io/styleguide/cppguide.html
# relevant rules are whitelisted, see all options with: cpplint --filter= # relevant rules are whitelisted, see all options with: cpplint --filter=
- --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+readability/braces - --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces
- repo: local - repo: local
hooks: hooks:
- id: test_translations - id: test_translations

@ -1,7 +1,7 @@
#pragma once #pragma once
typedef struct vec3 { typedef struct vec3 {
float v[3]; float v[3];
} vec3; } vec3;
typedef struct vec4 { typedef struct vec4 {
@ -9,7 +9,7 @@ typedef struct vec4 {
} vec4; } vec4;
typedef struct mat3 { typedef struct mat3 {
float v[3*3]; float v[3*3];
} mat3; } mat3;
typedef struct mat4 { typedef struct mat4 {

@ -7,7 +7,7 @@
class ONNXModel : public RunModel { class ONNXModel : public RunModel {
public: public:
ONNXModel(const std::string path, float *output, size_t output_size, int runtime, bool _use_tf8 = false, cl_context context = NULL); ONNXModel(const std::string path, float *output, size_t output_size, int runtime, bool _use_tf8 = false, cl_context context = NULL);
~ONNXModel(); ~ONNXModel();
void execute(); void execute();
private: private:
int proc_pid; int proc_pid;

@ -36,9 +36,9 @@ static void DeallocateBuffer(void* data, size_t) {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
TF_Buffer* buf; TF_Buffer* buf;
TF_Graph* graph; TF_Graph* graph;
TF_Status* status; TF_Status* status;
char *path = argv[1]; char *path = argv[1];
// load model // load model
{ {

@ -422,20 +422,20 @@ void CameraState::config_isp(int io_mem_handle, int fence, int request_id, int b
if (io_mem_handle != 0) { if (io_mem_handle != 0) {
io_cfg[0].mem_handle[0] = io_mem_handle; io_cfg[0].mem_handle[0] = io_mem_handle;
io_cfg[0].planes[0] = (struct cam_plane_cfg){ io_cfg[0].planes[0] = (struct cam_plane_cfg){
.width = ci.frame_width, .width = ci.frame_width,
.height = ci.frame_height + ci.extra_height, .height = ci.frame_height + ci.extra_height,
.plane_stride = ci.frame_stride, .plane_stride = ci.frame_stride,
.slice_height = ci.frame_height + ci.extra_height, .slice_height = ci.frame_height + ci.extra_height,
.meta_stride = 0x0, // YUV has meta(stride=0x400, size=0x5000) .meta_stride = 0x0, // YUV has meta(stride=0x400, size=0x5000)
.meta_size = 0x0, .meta_size = 0x0,
.meta_offset = 0x0, .meta_offset = 0x0,
.packer_config = 0x0, // 0xb for YUV .packer_config = 0x0, // 0xb for YUV
.mode_config = 0x0, // 0x9ef for YUV .mode_config = 0x0, // 0x9ef for YUV
.tile_config = 0x0, .tile_config = 0x0,
.h_init = 0x0, .h_init = 0x0,
.v_init = 0x0, .v_init = 0x0,
}; };
io_cfg[0].format = CAM_FORMAT_MIPI_RAW_12; // CAM_FORMAT_UBWC_TP10 for YUV io_cfg[0].format = CAM_FORMAT_MIPI_RAW_12; // CAM_FORMAT_UBWC_TP10 for YUV
io_cfg[0].color_space = CAM_COLOR_SPACE_BASE; // CAM_COLOR_SPACE_BT601_FULL for YUV io_cfg[0].color_space = CAM_COLOR_SPACE_BASE; // CAM_COLOR_SPACE_BT601_FULL for YUV
io_cfg[0].color_pattern = 0x5; // 0x0 for YUV io_cfg[0].color_pattern = 0x5; // 0x0 for YUV

@ -171,17 +171,17 @@ bool BMX055_Magn::perform_self_test() {
uint8_t forced = BMX055_MAGN_FORCED; uint8_t forced = BMX055_MAGN_FORCED;
// Negative current // Negative current
set_register(BMX055_MAGN_I2C_REG_MAG, forced | (uint8_t(0b10) << 6)); set_register(BMX055_MAGN_I2C_REG_MAG, forced | (uint8_t(0b10) << 6));
util::sleep_for(100); util::sleep_for(100);
read_register(BMX055_MAGN_I2C_REG_DATAX_LSB, buffer, sizeof(buffer)); read_register(BMX055_MAGN_I2C_REG_DATAX_LSB, buffer, sizeof(buffer));
parse_xyz(buffer, &x, &y, &neg_z); parse_xyz(buffer, &x, &y, &neg_z);
// Positive current // Positive current
set_register(BMX055_MAGN_I2C_REG_MAG, forced | (uint8_t(0b11) << 6)); set_register(BMX055_MAGN_I2C_REG_MAG, forced | (uint8_t(0b11) << 6));
util::sleep_for(100); util::sleep_for(100);
read_register(BMX055_MAGN_I2C_REG_DATAX_LSB, buffer, sizeof(buffer)); read_register(BMX055_MAGN_I2C_REG_DATAX_LSB, buffer, sizeof(buffer));
parse_xyz(buffer, &x, &y, &pos_z); parse_xyz(buffer, &x, &y, &pos_z);
// Put back in normal mode // Put back in normal mode
@ -206,9 +206,9 @@ bool BMX055_Magn::parse_xyz(uint8_t buffer[8], int16_t *x, int16_t *y, int16_t *
uint16_t data_r = (uint16_t) (((uint16_t)buffer[7] << 8) | buffer[6]) >> 2; uint16_t data_r = (uint16_t) (((uint16_t)buffer[7] << 8) | buffer[6]) >> 2;
assert(data_r != 0); assert(data_r != 0);
*x = compensate_x(trim_data, mdata_x, data_r); *x = compensate_x(trim_data, mdata_x, data_r);
*y = compensate_y(trim_data, mdata_y, data_r); *y = compensate_y(trim_data, mdata_y, data_r);
*z = compensate_z(trim_data, mdata_z, data_r); *z = compensate_z(trim_data, mdata_z, data_r);
} }
return ready; return ready;
} }

Loading…
Cancel
Save