diff --git a/client/ledcube.c b/client/ledcube.c index 993151f..66d1896 100644 --- a/client/ledcube.c +++ b/client/ledcube.c @@ -11,7 +11,7 @@ #include "ledcube.h" -/** +/*! \brief The setFrame function. * \param frame The 32bit frame data. Bit 0-8 equals layer one; bit 9 - 17 euqals layer two; bit 18 - 26 equals layer three. the 5 MSB is the lifetime of the current frame in ISR calls (300Hz). * \return NOT_CONNECTED_ERROR or the return value of the usb_control_msg function. */ @@ -30,7 +30,7 @@ int lc_setFrame(unsigned long frame) return ret; } -/** +/*! \brief The setMode function. * \param mode The firmware mode. MODE_ANIMATION_STOP; MODE_ANIMATION_SINGLE; MODE_ANIMATION_LOOP * \return NOT_CONNECTED_ERROR or the return value of the usb_control_msg function. */ @@ -42,7 +42,7 @@ int lc_setMode(int mode) return usb_control_msg(_lc_handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, CUSTOM_RQ_SET_MODE, mode, 0, _lc_buffer, 0, 300); } -/** +/*! \brief The saveFrame function. * \param frame The 32bit frame data. Bit 0-8 equals layer one; bit 9 - 17 euqals layer two; bit 18 - 26 equals layer three. the 5 MSB is the lifetime of the current frame in ISR calls (300Hz). * \param index The position in the EEPROM (0 to 31) of the internal animation content. * \return NOT_CONNECTED_ERROR or the return value of the usb_control_msg function. @@ -57,7 +57,23 @@ int lc_saveFrame(unsigned long frame, int index) return usb_control_msg(_lc_handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, CUSTOM_RQ_EEPROM_STORE_FRAME, 0, index, _lc_buffer, 0, 300); } -/** +/*! \brief The saveFrame function. + * \param frame The 32bit frame data. Bit 0-8 equals layer one; bit 9 - 17 euqals layer two; bit 18 - 26 equals layer three. The 5 MSB is the lifetime of the current frame in ISR calls (300Hz) multiplied by 8. + * \param deay The lifetime (onyl 5 bits) of the given frame in ISR calls multiplied by 8. + * \param index The position in the EEPROM (0 to 31) of the internal animation content. + * \return NOT_CONNECTED_ERROR or the return value of the usb_control_msg function. + */ +int lc_saveFrame(unsigned long frame, int delay, int index) +{ + if (_lc_handle == NULL) + return NOT_CONNECTED_ERROR; + + lc_setFrame(frame); + + return usb_control_msg(_lc_handle, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT, CUSTOM_RQ_EEPROM_STORE_FRAME, 0, index, _lc_buffer, 0, 300); +} + +/*! \brief The init function. * \return SUCCESSFULLY_CONNECTED or DEVICE_NOT_FOUND_ERROR. */ int lc_init() @@ -78,7 +94,7 @@ int lc_init() return SUCCESSFULLY_CONNECTED; } -/** +/*! \brief The close function. * \return NOT_CONNECTED_ERROR or return state of the usb_close function. */ int lc_close()