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

Fixes to hardware config editing/display #2765

Merged
merged 5 commits into from
Apr 15, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Apr 14, 2024

If name not specified when loading config then 'save' raises exception

For example, Basic_Ota sample doesn't have its name field set in ota.hw:

  • Run make hwconfig-edit
  • Click 'save'

So ensure we provide a default name based on filename.

Ensure all sample .hw files have names

For consistency.

Remove 'unused_before' and 'unused_after' fields from make hwconfig output

These are only used for map building so shouldn't be visible.
Example:

        "phy_init": {
            "device": "spiFlash",
            "address": "0x000fc000",
            "size": "4K",
            "type": "data",
            "subtype": "phy",
            "readonly": false,
            "encrypted": false,
            "filename": "$(FLASH_INIT_DATA)",
            "unused_before": 0, ///<
            "unused_after": 0   ///< Don't show
        },

Don't set name, comment fields from option data

For example, Basic_Blink sample uses default config. Running make hwconfig gives:

{
    "name": "Standard config with single ROM",
    "comment": "Should work with any Esp8266 variant",
    "arch": "Esp8266",
    "options": [],

If we run make hwconfig HWCONFIG_OPTS=4m we get this:

{
    "name": "",
    "comment": "",
    "arch": "Esp8266",
    "options": [
        "4m"
    ],

The name and comment have been wiped out, should be as before.

Fix use of not in and is not operators

e.g. x not in [...] preferred to not x in [...]

Copy link

what-the-diff bot commented Apr 14, 2024

PR Summary

  • Introduced a New Function to Extract File Name
    A new function named get_basename_no_ext has been created in the hwconfig/common.py file. It is designed to extract the base name of a file without its extension.

  • Enhanced Config Class with Additional Attributes
    The Config class in the hwconfig/config.py file has two new attributes, name and comment, making it more detailed and robust.

  • Modifications to Key Functions for Better Performance
    The functions get_dict_value, loadConfig, and the dict function in hwconfig/editor.py and hwconfig/partition.py respectively have been updated to improve their output and enhance their performance.

  • New Function to Save Files
    A new file saving function, fileSave, has been created in the hwconfig/editor.py file. It is designed to streamline the saving process of various documents.

  • Updated Hardware Configuration Files
    Several hardware configuration files, namely basic_ifs_Esp32.hw, basic_ifs_Esp8266.hw, basic_ifs_Host.hw, basic_ifs_Rp2040.hw, ota.hw, ftpserver-esp32.hw, and ftpserver-esp8266.hw have been updated to reflect the latest changes and improvements.

@slaff slaff added this to the 5.2.0 milestone Apr 15, 2024
@slaff slaff merged commit cf1e532 into SmingHub:develop Apr 15, 2024
46 checks passed
@mikee47 mikee47 deleted the fix/hwconfig-editor branch April 15, 2024 09:47
@slaff slaff mentioned this pull request May 8, 2024
5 tasks
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.

2 participants