Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directory structure for architecture-specific code and headers #12821

Merged
merged 12 commits into from
Aug 30, 2019

Conversation

bkueng
Copy link
Member

@bkueng bkueng commented Aug 28, 2019

PR from #12797. This includes everything except for the last 3 commits (the 'include' directory change, we can do that separately).
Changes from #12797: determine NuttX chip from NuttX config instead of specifying it in the board config.

Chip-specific directory structure:

platforms/nuttx/src/px4> tree
.
├── CMakeLists.txt
├── common
│   ├── CMakeLists.txt
│   ├── console_buffer.cpp
│   ├── include
│   │   └── px4_platform
│   │       ├── adc.h
│   │       └── micro_hal.h
│   ├── px4_init.cpp
│   ├── px4_nuttx_impl.cpp
│   └── px4_nuttx_tasks.c
├── nxp
│   ├── CMakeLists.txt
│   ├── k66
│   │   ├── CMakeLists.txt
│   │   └── include
│   │       └── px4_arch
│   │           ├── adc.h
│   │           ├── io_timer.h
│   │           └── micro_hal.h
│   └── kinetis
│       ├── adc
│       │   ├── adc.cpp
│       │   └── CMakeLists.txt
│       ├── hrt
│       │   ├── CMakeLists.txt
│       │   └── hrt.c
│       ├── include
│       │   └── px4_arch
│       │       ├── adc.h
│       │       └── io_timer.h
│       ├── io_pins
│       │   ├── CMakeLists.txt
│       │   ├── input_capture.c
│       │   ├── io_timer.c
│       │   ├── pwm_servo.c
│       │   └── pwm_trigger.c
│       ├── led_pwm
│       │   ├── CMakeLists.txt
│       │   └── led_pwm.cpp
│       └── tone_alarm
│           ├── CMakeLists.txt
│           └── ToneAlarmInterface.cpp
└── stm
    ├── CMakeLists.txt
    ├── stm32_common
    │   ├── adc
    │   │   ├── adc.cpp
    │   │   └── CMakeLists.txt
    │   ├── hrt
    │   │   ├── CMakeLists.txt
    │   │   └── hrt.c
    │   ├── include
    │   │   └── px4_arch
    │   │       ├── adc.h
    │   │       ├── io_timer.h
    │   │       ├── micro_hal.h
    │   │       └── px4io_serial.h
    │   ├── io_pins
    │   │   ├── CMakeLists.txt
    │   │   ├── input_capture.c
    │   │   ├── io_timer.c
    │   │   ├── pwm_servo.c
    │   │   └── pwm_trigger.c
    │   ├── led_pwm
    │   │   ├── CMakeLists.txt
    │   │   └── led_pwm.cpp
    │   └── tone_alarm
    │       ├── CMakeLists.txt
    │       ├── ToneAlarmInterface.cpp
    │       ├── ToneAlarmInterfaceGPIO.cpp
    │       └── ToneAlarmInterfacePWM.cpp
    ├── stm32f1
    │   ├── CMakeLists.txt
    │   ├── CMakeLists.txt.orig
    │   ├── include
    │   │   └── px4_arch
    │   │       ├── io_timer.h
    │   │       └── micro_hal.h
    │   └── io_timer.h
    ├── stm32f4
    │   ├── CMakeLists.txt
    │   ├── include
    │   │   └── px4_arch
    │   │       ├── adc.h
    │   │       ├── io_timer.h
    │   │       ├── micro_hal.h
    │   │       └── px4io_serial.h
    │   └── px4io_serial
    │       ├── CMakeLists.txt
    │       └── px4io_serial.cpp
    └── stm32f7
        ├── CMakeLists.txt
        ├── include
        │   └── px4_arch
        │       ├── adc.h
        │       ├── io_timer.h
        │       ├── micro_hal.h
        │       └── px4io_serial.h
        └── px4io_serial
            ├── CMakeLists.txt
            └── px4io_serial.cpp

@bkueng bkueng force-pushed the pr_arch_specific_code_restructuring branch 3 times, most recently from bbd8610 to 1c95aaa Compare August 28, 2019 11:27
@bkueng bkueng force-pushed the pr_arch_specific_code_restructuring branch from 1c95aaa to 2eeba72 Compare August 28, 2019 12:07
delete include:
for i in $(grep -rl 'px4_middleware.h' src platforms); do sed -i '/#include <px4_middleware.h/d' $i; done
@bkueng bkueng force-pushed the pr_arch_specific_code_restructuring branch from 2eeba72 to ae2631e Compare August 28, 2019 13:11
@bkueng
Copy link
Member Author

bkueng commented Aug 29, 2019

The output of bloaty looks as expected:

2019-08-28 13:18:38 URL:https://s3.amazonaws.com/px4-travis/Firmware/master/px4_fmu-v2_default.elf [14036408/14036408] -> "master.elf" [1]

     VM SIZE    

 -------------- 

  [NEW]    +352    ArchPX4IOSerial::_bus_exchange()

  [NEW]    +232    ArchPX4IOSerial::ioctl()

  [NEW]    +188    ArchPX4IOSerial::init()

  [NEW]    +168    px4_arch_adc_init

  [NEW]    +154    ArchPX4IOSerial::~ArchPX4IOSerial()

  [NEW]    +120    ArchPX4IOSerial::_do_interrupt()

  [NEW]     +94    px4_arch_adc_sample

  [NEW]     +68    ArchPX4IOSerial::_io_buffer_storage

  [NEW]     +52    ArchPX4IOSerial::ArchPX4IOSerial()

  [NEW]     +52    ArchPX4IOSerial::_abort_dma()

  [NEW]     +52    ArchPX4IOSerial::_do_rx_dma_callback()

  [NEW]     +40    ArchPX4IOSerial

  [NEW]     +32    serial_dma_call.9386

  +0.0%     +25    [section .text]

  +6.2%     +24    [section .bss]

  [NEW]     +20    channels_cache.9383

  [NEW]     +14    ArchPX4IOSerial::_interrupt()

  [NEW]     +10    ArchPX4IOSerial::_dma_callback()

  +8.5%      +8    ADC::~ADC()

  [NEW]      +8    base_time.9275

  [NEW]      +6    px4_arch_adc_temp_sensor_mask

  [NEW]      +4    boards_manifest.8842

  [NEW]      +4    k.9407

  [NEW]      +4    last_count.9276

  [NEW]      +4    px4_arch_adc_init::once

  [NEW]      +2    px4_arch_adc_uninit

  [ = ]       0    Airspeed::probe()

  [ = ]       0    LedController::update()

  [ = ]       0    PX4IO_Uploader::~PX4IO_Uploader()

  [ = ]       0    PX4IO_serial::init()

  [ = ]       0    [Unmapped]

  [ = ]       0    [section .debug_abbrev]

  [ = ]       0    [section .debug_aranges]

  [ = ]       0    [section .debug_frame]

  [ = ]       0    [section .debug_info]

  [ = ]       0    [section .debug_line]

  [ = ]       0    [section .debug_loc]

  [ = ]       0    [section .debug_ranges]

  [ = ]       0    [section .debug_str]

  [ = ]       0    [section .strtab]

  [ = ]       0    arm_disarm()

  [ = ]       0    cdev::CDev::poll_state()

  [ = ]       0    up_pwm_servo_init

  [DEL]      -4    board_adc_init::once

  [DEL]      -4    boards_manifest.8847

  [DEL]      -4    k.9412

  [DEL]      -4    last_count.9281

  [DEL]      -8    base_time.9280

  [DEL]     -10    PX4IO_serial_f4::_dma_callback()

  [DEL]     -14    PX4IO_serial_f4::_interrupt()

  -0.0%     -17    g_cromfs_image

  [DEL]     -20    channels_cache.9388

  [DEL]     -32    serial_dma_call.9391

  [DEL]     -40    PX4IO_serial_f4

  [DEL]     -52    PX4IO_serial_f4::PX4IO_serial_f4()

  [DEL]     -52    PX4IO_serial_f4::_abort_dma()

  [DEL]     -52    PX4IO_serial_f4::_do_rx_dma_callback()

  [DEL]     -68    PX4IO_serial_f4::_io_buffer_storage

  [DEL]     -94    board_adc_sample

  [DEL]    -120    PX4IO_serial_f4::_do_interrupt()

  [DEL]    -154    PX4IO_serial_f4::~PX4IO_serial_f4()

  [DEL]    -168    board_adc_init

  [DEL]    -188    PX4IO_serial_f4::init()

  [DEL]    -232    PX4IO_serial_f4::ioctl()

  [DEL]    -352    PX4IO_serial_f4::_bus_exchange()

  +0.0%     +48    TOTAL

@davids5 davids5 self-requested a review August 29, 2019 09:03
Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other then noted re inclusion paths, this looks good to me

@bkueng
Copy link
Member Author

bkueng commented Aug 30, 2019

Thanks for the review @davids5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants