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

Tab/single user #24

Merged
merged 10 commits into from
Aug 9, 2018
Merged

Tab/single user #24

merged 10 commits into from
Aug 9, 2018

Conversation

OnizukaX
Copy link
Collaborator

@OnizukaX OnizukaX commented Aug 7, 2018

Fixing issues: #1 and #20

Implemented as following:

  • front and rear light segments - each as (lower, upper) pairs [1; num_pixels] - are stored with Nffs as Peripheral settings (e.g. "traffic_front_lower")
  • default values are provided by the settings manager
  • colors are front = rgb(255, 255, 255), rear = rgb(255, 0, 0)
  • settings are configurable via the Central in the Popover, inputs are ranges [1; num_pixels]
  • if front/rear overlap, rear overwrites the front as per the sequential flow implemented
  • the LED library directly reads the settings (pointer passed over during init.) allowing one to change settings on the fly without having to reboot the Peripheral
  • a new TrafficMode has been introduced to the main tab

note: the lightninh direction is part of the issue #19

@OnizukaX OnizukaX requested a review from Beardmix August 7, 2018 19:05
Copy link
Owner

@Beardmix Beardmix left a comment

Choose a reason for hiding this comment

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

Good and cleaner code than before!
Well done :D

@@ -34,10 +43,14 @@ class EEPROM_Handler
{
}

void static load(Settings &settings)
void configure(void)
Copy link
Owner

Choose a reason for hiding this comment

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

This function should also be static, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could be yes, will set it static.

@@ -4,14 +4,10 @@
#include "ble_handler.h"
#include "eeprom_handler.h"

/* Need to undefine min and max in order to compile <String>. */
#undef max
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this not needed any more?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There was a namesapce conflict between libraries. I replaced the calls by constrain() and std::max() where needed.

// Front.
for (int i = std::max(this->p_settings->traffic_front_lower - 1, 0U); i < this->p_settings->traffic_front_upper; ++i)
{
strip.setPixelColor(i, strip.Color(255, 255, 255));
Copy link
Owner

Choose a reason for hiding this comment

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

A light yellow would be better. Pure white is generally too strong and aggressive, even at lower brightness settings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, will be changed later.

@OnizukaX OnizukaX merged commit 7d8bf79 into master Aug 9, 2018
@OnizukaX OnizukaX deleted the tab/single_user branch August 9, 2018 14:45
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.

None yet

2 participants