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

HD44780: Implement timing (busy/status and blink interval) based on the input clock. Add notes about device variants. [Lord Nightmare] #11776

Merged
merged 2 commits into from
Nov 26, 2023

Conversation

Lord-Nightmare
Copy link
Contributor

HD44780: Implement timing (busy/status and blink interval) based on the input clock. Add notes about device variants. [Lord Nightmare]

…he input clock. Add notes about device variants. [Lord Nightmare]
Copy link
Member

@cuavas cuavas left a comment

Choose a reason for hiding this comment

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

  • Isn’t the whole point of m_busy_factor to allow adjustment for different clock frequencies without using the configured clock frequency? Shouldn’t it be unnecessary if the configured clock frequency is used to calculate how long the device will be busy for?
  • Should you be quantising the busy time to intervals of the clock frequency?
  • Why aren’t you using attotime::from_ticks?

@cuavas
Copy link
Member

cuavas commented Nov 24, 2023

Please don’t force push unnecessarily when changing code for pull requests. It just makes it unnecessarily hard for reviewers because it’s harder to see what changed each time.

@Lord-Nightmare
Copy link
Contributor Author

Please don’t force push unnecessarily when changing code for pull requests. It just makes it unnecessarily hard for reviewers because it’s harder to see what changed each time.

This force-push was necessary because a change upstream made it un-merge-able. Absolutely no functional changes (or really any changes at all, other than fixing the merge conflict because git got confused) were made.

@angelosa
Copy link
Member

And that's doable by fixing thru git merge <head_branch> and fix the conflicts there (which will also report a cleaner commit in case you actively did some change there). Forcing is almost never the solution, it will break PR view.


usec = float(usec) * m_busy_factor + 0.5;
m_busy_timer->adjust(attotime::from_usec(usec));
m_busy_timer->adjust(attotime::from_hz(double(clock() / cycles) * m_busy_factor));
Copy link
Member

Choose a reason for hiding this comment

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

This will invert the result with busy_factor?
eg. busy factor 0.5, will make the busy flag duration twice longer, or 0.0 would mean 0Hz which is attotime::never.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be fixed now, although I'm going to see if I can completely remove the whole busy factor system in favor of just adjusting the clock for the few drivers that use it, in the future

Copy link
Member

Choose a reason for hiding this comment

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

Does anything have a busy factor of 0.0? If yes, then the fix is a divide by 0 crash.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing does, no.
And if I can make busy_factor go away completely, this will be a non-issue.

* use attotime::from_ticks
* properly capitalize SI suffixes
* fixed busy factor "polarity" in busy timer adjust, pending eventually removing busy factor entirely in the future
@Lord-Nightmare
Copy link
Contributor Author

  • Isn’t the whole point of m_busy_factor to allow adjustment for different clock frequencies without using the configured clock frequency? Shouldn’t it be unnecessary if the configured clock frequency is used to calculate how long the device will be busy for?

    • Should you be quantising the busy time to intervals of the clock frequency?

    • Why aren’t you using attotime::from_ticks?

I'm going to see if I can safely completely remove the busy factor from the few drivers that use it and ditch it entirely.

I've switched to attotime::from_ticks.

@happppp happppp merged commit 84d65b6 into mamedev:master Nov 26, 2023
5 checks passed
@cuavas
Copy link
Member

cuavas commented Nov 26, 2023

Why didn’t you wait for @Lord-Nightmare to try getting rid of the fudge factor? Also, please look at the commit message of the commit. Can people please think about release notes?

@happppp
Copy link
Member

happppp commented Nov 26, 2023

I told LN on discord this good for a 1st step.
I removed the meaningless cleanup messages when I squashed the commits.

@cuavas
Copy link
Member

cuavas commented Nov 26, 2023

I removed the meaningless cleanup messages when I squashed the commits.

Look at the squashed commit – the message appears twice.

@happppp
Copy link
Member

happppp commented Nov 26, 2023

Ah I see now, yes the PR title is the 1st line of the commit msg.

@cuavas
Copy link
Member

cuavas commented Nov 26, 2023

Ah I see now, yes the PR title is the 1st line of the commit msg.

When you go to merge the PR there are two edit fields. The first (one-line) edit field is the first line of the commit message. A blank line is automatically added after this. The second (multi-line) edit field is the rest of the commit message.

einstein95 pushed a commit to einstein95/mame that referenced this pull request Mar 2, 2024
…he input clock. Add notes about device variants. [Lord Nightmare] (mamedev#11776)

* HD44780: Implement timing (busy/status and blink interval) based on the input clock. Add notes about device variants. [Lord Nightmare]
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

4 participants