Skip to content

Commit

Permalink
Documentation fixup arm9/image.h, nds/tmers.h (devkitPro#17)
Browse files Browse the repository at this point in the history
* Better math preamble.

* Corrected 4 spelling errors in arm9/video.h preamble.

* Clarify arm9/image.h documentation.

* Corrected various errors in timers.h documentation

- Mhz => MHz, hz is not a real unit
- Added spaces to verious words
- Interupt => Interrupt

* Applied pull request comments

devkitPro#17
  • Loading branch information
awiebe authored and mtheall committed Feb 7, 2017
1 parent 1119663 commit fd7b58e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
16 changes: 8 additions & 8 deletions include/nds/arm9/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
\brief An image abstraction for working with image data.
<div class="fileHeader">
Image data pointers must be allocated using malloc as the conversion
rutiens will free the pointers and allocate new data. As such any loader
implemented utilizing this structure must use malloc() to allocate the image
pointer data.
Image data buffers must be allocated using malloc() rather than pointing to stack data, as the conversion
routines will free() the argument's image buffer and allocate a new block for the replacement data.
As such, any loader implemented utilizing this structure must use malloc() to allocate the image
buffer.
</div>
*/

Expand Down Expand Up @@ -70,17 +70,17 @@ typedef struct sImage
extern "C" {
#endif

/*! \brief Converts a 24 bit image to 16 bit
/*! \brief Destructively converts a 24-bit image to 16-bit
\param img a pointer to image to manipulate
*/
void image24to16(sImage* img);

/*! \brief Converts an 8 bit image to 16 bit setting the alpha bit
/*! \brief Destructively converts an 8-bit image to 16 bit setting the alpha bit
\param img a pointer to image to manipulate
*/
void image8to16(sImage* img);

/*! \brief Converts an 8 bit image to 16 bit with alpha bit cleared for the supplied palette index
/*! \brief Destructively converts an 8-bit image to 16-bit with alpha bit cleared for the supplied palette index
\param img a pointer to image to manipulate
\param transparentColor Color indexes equal to this value will have the alpha bit clear
*/
Expand All @@ -91,7 +91,7 @@ void image8to16trans(sImage* img, u8 transparentColor);
*/
void imageDestroy(sImage* img);

/*! \brief Tiles 8 bit image data into a sequence of 8x8 tiles
/*! \brief Tiles 8-bit image data into a sequence of 8x8 tiles
\param img a pointer to image to manipulate
*/
void imageTileData(sImage* img);
Expand Down
26 changes: 13 additions & 13 deletions include/nds/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ extern "C" {
/*! \see TIMER_CR(n)
\see TIMER_FREQ(n)
%TIMER_DATA(n) when set will latch that value into the counter. Everytime the
counter rolls over %TIMER_DATA(0) will return to the latched value. This allows
%TIMER_DATA(n) when set will latch that value into the counter. Every time the
counter rolls over, %TIMER_DATA(0) will return to the latched value. This allows
you to control the frequency of the timer using the following formula:\n
%TIMER_DATA(x) = -(BUS_CLOCK/(freq * divider));
Expand All @@ -100,7 +100,7 @@ extern "C" {

//! Enables the timer.
#define TIMER_ENABLE (1<<7)
//! Causes the timer to request an Interupt on overflow.
//! Causes the timer to request an Interrupt on overflow.
#define TIMER_IRQ_REQ (1<<6)
//! When set will cause the timer to count when the timer below overflows (unavailable for timer 0).
#define TIMER_CASCADE (1<<2)
Expand All @@ -116,13 +116,13 @@ typedef enum {


//use the ClockDivider enum.
// Causes the timer to count at 33.514 Mhz.
// Causes the timer to count at 33.514 MHz.
#define TIMER_DIV_1 (0)
// Causes the timer to count at (33.514 / 64) Mhz.
// Causes the timer to count at (33.514 / 64) MHz.
#define TIMER_DIV_64 (1)
// Causes the timer to count at (33.514 / 256) Mhz.
// Causes the timer to count at (33.514 / 256) MHz.
#define TIMER_DIV_256 (2)
// Causes the timer to count at (33.514 / 1024) Mhz.
// Causes the timer to count at (33.514 / 1024) MHz.
#define TIMER_DIV_1024 (3)


Expand Down Expand Up @@ -202,18 +202,18 @@ typedef enum {


/*! \brief start a hardware timer.
Callback is tied directly to interupt table and called directly resulting in less latency than the attached timer.
Callback is tied directly to interrupt table and called directly, resulting in less latency than the attached timer.
\param timer The hardware timer to use (0 - 3).
\param divider The timer channel clock divider (clock will tick at 33.513982 Mhz / divider)
\param divider The timer channel clock divider (clock will tick at 33.513982 MHz / divider)
\param ticks The number of ticks which must elapse before the timer overflows
\param callback The callback to be called when the timer expires (if null no irq will be generated by the timer)
\param callback The callback to be called when the timer expires (if null, no IRQ will be generated by the timer)
*/
void timerStart(int timer, ClockDivider divider, u16 ticks, VoidFn callback);


/*! \brief returns the ticks elapsed since the last call to timerElapsed().
\param timer The hardware timer to use (0 - 3).
\return The number of ticks which have elapsed since the last callto timerElapsed().
\return The number of ticks which have elapsed since the last call to timerElapsed().
*/
u16 timerElapsed(int timer);

Expand All @@ -230,7 +230,7 @@ u16 timerTick(int timer) {

/*! \brief pauses the specified timer.
\param timer The hardware timer to use (0 - 3).
\return The number of ticks which have elapsed since the last callto timerElapsed().
\return The number of ticks which have elapsed since the last call to timerElapsed().
*/
u16 timerPause(int timer);

Expand All @@ -246,7 +246,7 @@ void timerUnpause(int timer) {

/*! \brief Stops the specified timer.
\param timer The hardware timer to use (0 - 3).
\return The number of ticks which have elapsed since the last callto timerElapsed().
\return The number of ticks which have elapsed since the last call to timerElapsed().
*/
u16 timerStop(int timer);

Expand Down

0 comments on commit fd7b58e

Please sign in to comment.