Skip to content

Conversation

@Ellerbach
Copy link
Member

@Ellerbach Ellerbach commented May 24, 2022

Description

Add M5Stack Tough

Motivation and Context

  • Add M5Stack Tough

How Has This Been Tested?

Need to be tested.

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

@nfbot nfbot added the Type: enhancement New feature or request label May 24, 2022
@josesimoes josesimoes force-pushed the add-tough branch 7 times, most recently from 6360482 to 5ae80bc Compare May 26, 2022 08:27
- Rework Screen class for Core2 and Tough.
- Update nugets.
@josesimoes
Copy link
Member

@Ellerbach I've refactor a bit the Core2ToughCommon class. Namely:

  • Properties: had to wrap some to make them available only when they exist.
  • Constructor: reorder the code, adjusted some bits that weren't following M5Stack values and add the missing bits for the Tough.

Also some refactoring with the Screen class:

  • Some renames
  • Rework the Enable code to deal only with the backlight. As it was it was disabling the power for all peripherals (they all share the same power rail).
  • Rename the luminosity to brightness (for consistency with common nomenclature).

@josesimoes
Copy link
Member

@Ellerbach we need to rethink the touch implementation too. The Tough doesn't have "buttons" as the Core2.
So it' up to the application layer to setup the touch "objects" on the screen and deal with the touch events.
Suggest that we remove the touch for now until we figure it out.


#endif

// Setup buttons
Copy link
Member Author

Choose a reason for hiding this comment

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

technically, it's not the buttons, just the GPIO controller ;-)
Btw, we can avoid this as not used in the Core2 or the Tough and do like the others with lazy loading in this case.

Copy link
Member

Choose a reason for hiding this comment

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

Fine with me... I know the guy who coded this, I'll bring this to his attention... 😝

Copy link
Member Author

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

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

Very little things otherwise looks all good!

Copy link
Member Author

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

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

Only thing missing now if adjusting the property to get the GpioController. So far it's not done! IT's a common one to the rest. So need to be adjusted ;-)

@josesimoes josesimoes marked this pull request as ready for review May 31, 2022 15:57
_power.ChargingCuttOffVoltage = ChargingCutOffVoltage.V4_2;

// Setup buttons
_gpio = new();
Copy link
Member Author

Choose a reason for hiding this comment

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

This must stay here because of the buttons

@josesimoes
Copy link
Member

Ignoring Sonarcloud duplication error.

_power.ChargingCuttOffVoltage = ChargingCutOffVoltage.V4_2;

// Setup buttons
_gpio = new();
Copy link
Member Author

Choose a reason for hiding this comment

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

This must stay here because of the buttons

- Update code in all variants.
Copy link
Member Author

@Ellerbach Ellerbach 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 to me! Can't approve as I'm the original author! So feel free to approve and merge!

@josesimoes josesimoes merged commit a93d94a into main May 31, 2022
@josesimoes josesimoes deleted the add-tough branch May 31, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants