From: Antonio Ospite Date: Wed, 20 Jun 2012 11:13:20 +0000 (+0200) Subject: am7xxx: update signature and documentation of am7xxx_set_power_mode() X-Git-Tag: v0.1.3~16^2~3 X-Git-Url: https://git.ao2.it/libam7xxx.git/commitdiff_plain/575c6d3423fc3b93729c61f0a9a45469cb62faeb?hp=b3cc25c31d6bfc95aa1bd8a63c85f0b5cab60d11 am7xxx: update signature and documentation of am7xxx_set_power_mode() In the signature, rename the 'mode' parameter to 'power' in order to show better what it is about, after all in am7xxx_set_zoom_mode() the correspondent parameter has been called zoom. In the documentation tells about the new guesses about what the expected behavior after AM7XXX_POWER_OFF is. --- diff --git a/src/am7xxx.c b/src/am7xxx.c index 5481075..5b98b84 100644 --- a/src/am7xxx.c +++ b/src/am7xxx.c @@ -846,7 +846,7 @@ AM7XXX_PUBLIC int am7xxx_send_image(am7xxx_device *dev, return send_data(dev, image, image_size); } -AM7XXX_PUBLIC int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode mode) +AM7XXX_PUBLIC int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode power) { int ret; struct am7xxx_header h = { @@ -857,7 +857,7 @@ AM7XXX_PUBLIC int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode mo .unknown3 = 0x10, }; - switch(mode) { + switch(power) { case AM7XXX_POWER_OFF: h.header_data.power.bit2 = 0; h.header_data.power.bit1 = 0; @@ -889,7 +889,7 @@ AM7XXX_PUBLIC int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode mo break; default: - error(dev->ctx, "Power mode not supported!\n"); + error(dev->ctx, "Unsupported power mode.\n"); return -EINVAL; }; diff --git a/src/am7xxx.h b/src/am7xxx.h index 885cef2..24636c3 100644 --- a/src/am7xxx.h +++ b/src/am7xxx.h @@ -244,17 +244,18 @@ int am7xxx_send_image(am7xxx_device *dev, /** * Set the power mode of an am7xxx device. * - * \note If we set the mode to AM7XXX_POWER_OFF we can't turn the - * display on again by using only am7xxx_set_power_mode(). This needs to be - * investigated, maybe some other command can reset the device. + * @note When setting the mode to AM7XXX_POWER_OFF the display can't be turned + * on again by using only am7xxx_set_power_mode(), am7xxx_set_zoom_mode() has + * to be called first, the current guess is that the latter performs some + * other resets beside setting the zoom mode. * - * @param[in] dev A pointer to the structure representing the device to get info of - * @param[in] mode The power mode to put the device in (see @link am7xxx_power_mode @endlink enum) + * @param[in] dev A pointer to the structure representing the device to set power mode to + * @param[in] power The power mode to put the device in (see #am7xxx_power_mode enum) * * @return 0 on success, a negative value on error * */ -int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode mode); +int am7xxx_set_power_mode(am7xxx_device *dev, am7xxx_power_mode power); /** * Set the zoom mode of an am7xxx device.