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

Dynamic configuration #12

Merged
merged 10 commits into from Sep 12, 2021
Merged

Dynamic configuration #12

merged 10 commits into from Sep 12, 2021

Conversation

carlk3
Copy link
Owner

@carlk3 carlk3 commented Sep 5, 2021

Move hw_config.c out of FatFs_SPI library so that the library can better function as a submodule.

Add dynamic configuration example in directory dynamic_config_example.

@carlk3 carlk3 mentioned this pull request Sep 5, 2021
Copy link

@fruit-bat fruit-bat left a comment

Choose a reason for hiding this comment

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

I've tried the changes in my application and they work fine... many thanks! I've added a few comments which relate to a potential minor tidy up of the interface. I don't think sd_get_by_name() or get_fs_by_name() form a part of it... any more. Apologies, if this is my misunderstanding.

Comment on lines 90 to 95
FATFS *get_fs_by_name(const char *name) {
for (size_t i = 0; i < sd_get_num(); ++i)
if (0 == strcmp(sd_cards[i].pcName, name)) return &sd_cards[i].fatfs;
DBG_PRINTF("%s: unknown name %s\n", __func__, name);
return NULL;
}

Choose a reason for hiding this comment

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

Possibly redundant? Perhaps get_fs_by_name should be removed from hw_config.h?

Copy link
Owner Author

Choose a reason for hiding this comment

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

OK, I moved sd_get_by_name and get_fs_by_name out of hw_config.

Choose a reason for hiding this comment

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

Cheers

Comment on lines 76 to 81
sd_card_t *sd_get_by_name(const char *const name) {
for (size_t i = 0; i < sd_get_num(); ++i)
if (0 == strcmp(sd_cards[i].pcName, name)) return &sd_cards[i];
DBG_PRINTF("%s: unknown name %s\n", __func__, name);
return NULL;
}

Choose a reason for hiding this comment

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

Possibly redundant? Perhaps sd_get_by_name should be removed from hw_config.h?

Comment on lines 27 to 32
sd_card_t *sd_get_by_name(const char *name) {
for (size_t i = 0; i < sd_get_num(); ++i)
if (0 == strcmp(sd_cards[i]->pcName, name)) return sd_cards[i];
DBG_PRINTF("%s: unknown name %s\n", __func__, name);
return NULL;
}

Choose a reason for hiding this comment

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

Possibly redundant? Perhaps sd_get_by_name should be removed from hw_config.h?

Comment on lines 41 to 46
FATFS *get_fs_by_name(const char *name) {
for (size_t i = 0; i < sd_get_num(); ++i)
if (0 == strcmp(sd_cards[i]->pcName, name)) return &sd_cards[i]->fatfs;
DBG_PRINTF("%s: unknown name %s\n", __func__, name);
return NULL;
}

Choose a reason for hiding this comment

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

Possibly redundant? Perhaps get_fs_by_name should be removed from hw_config.h?

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