8000 uint8_t < 256 is always true by rkone · Pull Request #747 · nkolban/esp32-snippets · GitHub
[go: up one dir, main page]

Skip to content

uint8_t < 256 is always true #747

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

Merged
merged 1 commit into from
Dec 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cpp_utils/MMU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static uint32_t flashPageToOffset(uint32_t page) {
const uint32_t mappingInvalid = 1 << 8;

printf("PRO CPU MMU\n");
for (uint8_t i = 0; i < 256; i++) {
for (uint16_t i = 0; i < 256; i++) {
if (!(DPORT_PRO_FLASH_MMU_TABLE[i] & mappingInvalid)) {
addressRange_t addressRange = entryNumberToAddressRange(i);
printf("Entry: %2d (0x%8.8x - 0x%8.8x), Page: %d - offset: 0x%x\n",
Expand All @@ -59,7 +59,7 @@ static uint32_t flashPageToOffset(uint32_t page) {
}
printf("\n");
printf("APP CPU MMU\n");
for (uint8_t i = 0; i < 256; i++) {
for (uint16_t i = 0; i < 256; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

One question, is it better to change value type or maybe its just a typo and should be < 255?

if (!(DPORT_APP_FLASH_MMU_TABLE[i] & mappingInvalid)) {
addressRange_t addressRange = entryNumberToAddressRange(i);
printf("Entry: %2d (0x%8.8x - 0x%8.8x), Page: %d - offset: 0x%x\n",
Expand Down
0