Skip to content

Conversation

@ccollins476ad
Copy link
Contributor

@ccollins476ad ccollins476ad commented Mar 28, 2018

This new header (os/mynewt.h) includes the following headers:

  • syscfg/syscfg.h
  • sysinit/sysinit.h
  • sysflash/sysflash.h
  • os/os.h
  • defs/error.h

This header is intended to be included before any other non-system headers. The purpose of this header is to make an application developer's job easier, and simplify the "getting started" process.

I think a good rule of thumb is: always include os/mynewt.h and never directly include any of the headers listed above.

I put this header in the kernel/os package because, in practice, every other package has access to this one. I am happy to move it somewhere else if there are alternative ideas.

I was tempted to include bsp/bsp.h in this header, but I decided it is better if Mynewt doesn't make any assumptions about which files the BSP exports.

I tested this PR with newt test all and by successfully building the following targets (most target definitions can be inferred from their names):

blecent-nrf51dk
blecent-nrf52dk
blehci-nrf51dk
blehci-nrf52dk
blehr-nrf52dk
bleprph-ada_feather_nrf52
bleprph-arduino_primo_nrf52
bleprph-bbc_microbit
bleprph-nrf51dk
bleprph-nrf51dk-16kbram
bleprph-nrf52-thingy
bleprph-nrf52dk
bleprph_oic-nrf52dk
blesplit-bbc_microbit
blesplit-nrf51dk
blesplit-nrf52dk
bletiny-bmd300
bletiny-nrf52dk
bletiny-nrf52dk-noleg
bletiny-nrf52dk-nosc
bleuart-nrf52dk
blinky-ada_feather_nrf52
blinky-apollo2_evb
blinky-arduino_primo_nrf52
blinky-bbc_microbit
blinky-ble400
blinky-bmd200
blinky-bmd300eval
blinky-calliope_mini
blinky-frdm-k64f
blinky-native
blinky-nina-b1
blinky-nrf51-arduino_101
blinky-nrf51-blenano
blinky-nrf51dk
blinky-nrf51dk-16kbram
blinky-nrf52-thingy
blinky-nrf52840pdk
blinky-nrf52dk
blinky-nucleo-f303k8
blinky-nucleo-f303re
blinky-nucleo-f401re
blinky-nucleo-f413re
blinky-nucleo-f413zh
blinky-olimex-p103
blinky-olimex_stm32-e407_devboard
blinky-puckjs
blinky-rb-blend2
blinky-rb-nano2
blinky-ruuvi_tag_revb2
blinky-stm32f3discovery
blinky-stm32f429discovery
blinky-stm32f4discovery
blinky-stm32f767-nucleo
blinky-stm32f7discovery
blinky-stm32l152discovery
blinky-telee02
blinky-usbmkw41z
blinky-vbluno51
blinky-vbluno52
boot-101
boot-apollo2_evb
boot-arduino_primo_nrf52
boot-bbc_microbit
boot-bmd300eval
boot-frdm-k64f
boot-nrf51dk
boot-nrf51dk-16kbram
boot-nrf52dk
boot-nucleo-f413re
boot-nucleo413zh
boot-olimex_stm32-e407_devboard
boot-rb-nano2
boot-serial-nrf52dk
boot-telee02
bsncent-nrf52dk
bsnprph-nrf52dk
btshell-native
btshell-nrf52dk
iptest_f7
my_blinky_sim
ocf_sample-nrf52dk
ocf_sample-sim
sensors_test-nrf52dk
slinky-apollo2_evb
slinky-nrf51dk
slinky-nrf51dk-16kbram
slinky-nrf52dk
slinky-olimex_stm32-e407_devboard
slinky-sim
slinky_oic-nrf52dk
slinky_oic-sim
spitest-m-apollo2_evb
spitest-nrf52dk
spitest-nucleo-f413re
spitest-nucleo-f413zh
spitest-s-nrf52dk
split-nrf51dk
splitty-nrf52dk
testbench-nrf51dk
testbench-nrf52dk
timtest-nrf52dk

This header includes the following headers:

    * syscfg/syscfg.h
    * sysinit/sysinit.h
    * sysflash/sysflash.h
    * os/os.h
    * defs/error.h

This header is intended to be included before any other non-system
headers.
Copy link
Contributor

@vrahane vrahane left a comment

Choose a reason for hiding this comment

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

Looks good.

Copy link
Member

@utzig utzig left a comment

Choose a reason for hiding this comment

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

Too complicated to review thoroughly but looks good in a glance!

@ccollins476ad ccollins476ad merged commit 5561160 into apache:master Mar 30, 2018
@ccollins476ad ccollins476ad deleted the mynewt.h branch March 30, 2018 01:22
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.

3 participants