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

Master logical led #10579

Merged
merged 19 commits into from
Nov 19, 2018
Merged

Master logical led #10579

merged 19 commits into from
Nov 19, 2018

Conversation

davids5
Copy link
Member

@davids5 davids5 commented Sep 26, 2018

This PR is the groundwork to fix the power LED blinking on V5

Background:

Early boards only had an AMBER LED that was used to
indicate a High Load condition.

This change defines the new logical interface
the LED_ should not be used in application
code moving forward, only the manipulator macros
should be used.

   Logical usage             Legacy default
  ------------------------+-------------
   BOARD_OVERLOAD_LED     | LED_RED

Later boards defined BOARD_HAS_CONTROL_STATUS_LEDS
and added the use of a BLUE and GREEN LED that were
used as follows:

Logical usage Legacy default
------------------------+-------------
BOARD_ARMED_LED | LED_BLUE
BOARD_ARMED_STATE_LED | LED_GREEN

With this PR a board may now define only a subset
the leds and map them at the board level to the
color LED it wants to use.

   Logical usage             Legacy default
  ------------------------+-------------
   BOARD_OVERLOAD_LED     | LED_RED
when BOARD_HAS_CONTROL_STATUS_LEDS is defined
   BOARD_ARMED_LED        | LED_BLUE
   BOARD_ARMED_STATE_LED  | LED_GREEN

If any of the BOARD_{OVERLOAD|ARMED|ARMED_STATE}_LED are not defined. The code output generates a null action for that LED.

@davids5 davids5 requested a review from dagar September 26, 2018 18:50
@davids5
Copy link
Member Author

davids5 commented Sep 26, 2018

@PX4/testflights - Please test this against master.

Note only the onboard LED behavior. AMBER or RED, BLUE and GREEN leds. master and this PR should look the same on all HW except for

FMUV5 (and FMUv5 mini RC5) - the Power (Green LED) should be on solid and the ACT (Blue LED) should blink.

Note on my FMUv4pro the leds (in the case) are installed backwards and do not work. FYI @klopezal

@santiago3dr
Copy link

ran this against master on a pixhawk 1 running v2 and a pixhawk mini with v3
blue green and red all look the same against master, not sure how to test amber

@Avysuarez
Copy link

tested with pixhawk 2.1 and 4. is the same at the master

@davids5
Copy link
Member Author

davids5 commented Sep 27, 2018

ran this against master on a pixhawk 1 running v2 and a pixhawk mini with v3
blue green and red all look the same against master, not sure how to test amber

@santiago3dr we would need to create a heavy load on cpu.

Here is one way to do it. (tested on a FMUv5 mini)
use fmu mode_pwm3cap1 and then run top place a signal generator on FMU_CH4 with a square wave of 400,000 Hz. 3.3Vp-p. The load should go to ~93% The load light (red) will light.

@dannyfpv
Copy link

tested with pixhawk pro v4 and pixhawk mini v3. is the same at the master

@davids5
Copy link
Member Author

davids5 commented Sep 28, 2018

@dagar - I would say good to go

@@ -71,6 +71,10 @@
#define GPIO_LED_BLUE_L (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN2)

#define BOARD_HAS_CONTROL_STATUS_LEDS 1
#define BOARD_HAS_CONTROL_STATUS_LEDS 1
Copy link
Member

Choose a reason for hiding this comment

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

duplicate line

Copy link
Member Author

Choose a reason for hiding this comment

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

@fixed, based on current master

@davids5
Copy link
Member Author

davids5 commented Nov 2, 2018

@dagar - can we get this into master and on the BP for the mini?

David Sidrane added 14 commits November 19, 2018 11:08
   This commit is the groundwork to fix the power LED
   blinking on V5

   Background:
   ----------
   Early boards only had an AMBER LED that was used to
   indicate a High Load condition.

   This change defines the new logical inteface
   the LED_<color> should not be used in application
   code moving forward, only the minipulator macros
   should be used.

       Logical usage             Legacy default
      ------------------------+-------------
       BOARD_OVERLOAD_LED     | LED_RED

   Later boards defined BOARD_HAS_CONTROL_STATUS_LEDS
   and added the use of a BLUE and GREEN LED that were
   used as follows:

   Logical usage             Legacy default
      ------------------------+-------------
       BOARD_ARMED_LED        | LED_BLUE
       BOARD_ARMED_STATE_LED  | LED_GREEN

   With this PR a board may now define _only_ a subset
   the leds and map them at the board level to the
   color LED it wants to use.

       Logical usage             Legacy default
      ------------------------+-------------
       BOARD_OVERLOAD_LED     | LED_RED
    when BOARD_HAS_CONTROL_STATUS_LEDS is defined
       BOARD_ARMED_LED        | LED_BLUE
       BOARD_ARMED_STATE_LED  | LED_GREEN

   If any of the BOARD_{OVERLOAD|ARMED|ARMED_STATE}_LED are not
   defined. The code output generates a null action for that
   LED.
   add support for all the LEDS to support
   BOARD_HAS_CONTROL_STATUS_LEDS
    Define the logical LED that are uses on aerofc-v1
    Define the logical LED that are uses on auav-x21
    Define the logical LED that are uses on crazyflie
    Define the logical LED that are uses on mindpx-v2
    Define the logical LED that are uses on nxphlite-v3
    Define the logical LED that are uses on omnibus-f4sd
    Define the logical LED that are uses on px4-same70xplained-v1
    Define the logical LED that are uses on px4-stm32f4discovery
    Define the logical LED that are uses on px4fmu-v2
    Define the logical LED that are uses on px4fmu-v4
David Sidrane added 5 commits November 19, 2018 11:08
    Define the logical LED that are uses on px4fmu-v4pro
    Define the logical LED that are uses on px4fmu-v5
    Define the logical LED that are uses on px4nucleoF767ZI-v1
    Define the logical LED that are uses on sitl
@dagar dagar merged commit 1d12827 into master Nov 19, 2018
@dagar dagar deleted the master_logical_led branch November 19, 2018 21:11
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.

5 participants