-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add header guards and fix some compiler warnings #29
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
#ifndef __MEGA65_DEBUG_H | ||
#define __MEGA65_DEBUG_H | ||
|
||
void debug_msg(char* m); | ||
|
||
#endif // __MEGA65_DEBUG_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
|
||
void usleep(uint32_t micros); | ||
|
||
#endif | ||
#endif // __MEGA65_HAL_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
#include <stdint.h> | ||
|
||
#ifndef __MEGA65_RANDOM_H | ||
#define __MEGA65_RANDOM_H | ||
|
||
uint32_t random32(uint32_t range); | ||
uint16_t random16(uint16_t range); | ||
uint8_t random8(uint8_t range); | ||
void srand(uint32_t seed); | ||
uint8_t rand8(uint8_t range); | ||
uint16_t rand16(uint16_t range); | ||
uint32_t rand32(uint32_t range); | ||
|
||
#endif // __MEGA65_RANDOM_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,6 +180,7 @@ void mega65_sdcard_unmap_sector_buffer(void) | |
|
||
unsigned short timeout; | ||
|
||
// @todo Return -1 corresponds to 255. Is this what we want? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume all bits set is an error value. This corresponds a bit to |
||
uint8_t mega65_sdcard_readsector(const uint32_t sector_number) | ||
{ | ||
char tries = 0; | ||
|
@@ -267,6 +268,7 @@ uint8_t mega65_sdcard_readsector(const uint32_t sector_number) | |
|
||
uint8_t verify_buffer[512]; | ||
|
||
// @todo Return -1 corresponds to 255. Is this what we want? | ||
uint8_t mega65_sdcard_writesector(const uint32_t sector_number) | ||
{ | ||
// Copy buffer into the SD card buffer, and then execute the write job | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this one
/* .. */
is used, but the rest in the PR uses//
. It would hurt if it was consistent, using//
is C99 and will not work with C89/C94. C99 is close to 25 years old, but I do not know if we expect issues with old compilers?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh ok, I think we can resolve it in a separate issue, either now or when a new compiler becomes relevant. I'm unsure of what standards are out there.