Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 16:0f8e730f3272, committed 2013-04-20
- Comitter:
- aplatanado
- Date:
- Sat Apr 20 12:50:42 2013 +0000
- Parent:
- 15:096f5e07d159
- Commit message:
- apply some coding style rules to macros
Changed in this revision
| adns9500.cpp | Show annotated file Show diff for this revision Revisions of this file |
| adns9500.hpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/adns9500.cpp Fri Apr 19 14:39:45 2013 +0000
+++ b/adns9500.cpp Sat Apr 20 12:50:42 2013 +0000
@@ -91,7 +91,7 @@
// check observation register bits [5:0]
int observation = spiReceive(OBSERVATION);
- if (! ADNS9500_IF_OBSERVATION_TEST(observation)) {
+ if (! ADNS9500_PASS_OBSERVATION_TEST(observation)) {
WAIT_TSCLKNCS();
ncs_.write(1);
@@ -247,7 +247,7 @@
WAIT_TSCLKNCS();
ncs_.write(1);
- if (ADNS9500_IF_LASER_FAULT(motion))
+ if (ADNS9500_HAS_LASER_FAULT(motion))
error("ADNS9500::sromDownload : laser fault condition detected\n");
// return the SROM CRC value
@@ -300,7 +300,7 @@
dy = 0;
int motion = spiReceive(MOTION);
- if (ADNS9500_IF_MOTION(motion)) {
+ if (ADNS9500_HAS_MOTION_DETECTED(motion)) {
WAIT_TSRR();
int dxl = spiReceive(DELTA_X_L);
WAIT_TSRR();
@@ -315,7 +315,7 @@
WAIT_TSCLKNCS();
ncs_.write(1);
- return ADNS9500_IF_MOTION(motion);
+ return ADNS9500_HAS_MOTION_DETECTED(motion);
}
bool ADNS9500::getMotionDeltaMM(float& dx, float& dy)
@@ -378,7 +378,7 @@
WAIT_TSCLKNCS();
ncs_.write(1);
- return ADNS9500_IF_MOTION(data.motion);
+ return ADNS9500_HAS_MOTION_DETECTED(data.motion);
}
void ADNS9500::setResolution(Resolution xy_resolution)
@@ -451,7 +451,7 @@
// check for first pixel reading motion bit
int motion = spiReceive(MOTION);
WAIT_TSRR();
- while(! ADNS9500_IF_FRAME_FIRST_PIXEL(motion)) {
+ while(! ADNS9500_HAS_FIRST_PIXEL(motion)) {
int motion = spiReceive(MOTION);
WAIT_TSRR();
}
--- a/adns9500.hpp Fri Apr 19 14:39:45 2013 +0000 +++ b/adns9500.hpp Sat Apr 20 12:50:42 2013 +0000 @@ -28,11 +28,11 @@ #define ADNS9500_LASER_CTRL0_FORCE_DISABLED (1 << 0) #define ADNS9500_OBSERVATION_CHECK_BITS 0x3f -#define ADNS9500_IF_MOTION(x) (bool)(x & 0x80) -#define ADNS9500_IF_LASER_FAULT(x) (bool)(x & 0x40) -#define ADNS9500_IF_RUNNING_SROM_CODE(x) (bool)(x & 0x80) -#define ADNS9500_IF_FRAME_FIRST_PIXEL(x) (bool)(x & 0x01) -#define ADNS9500_IF_OBSERVATION_TEST(x) (bool)(x & ADNS9500_OBSERVATION_CHECK_BITS) +#define ADNS9500_HAS_MOTION_DETECTED(x) (bool)(x & 0x80) +#define ADNS9500_HAS_LASER_FAULT(x) (bool)(x & 0x40) +#define ADNS9500_IS_RUNNING_SROM_CODE(x) (bool)(x & 0x80) +#define ADNS9500_HAS_FIRST_PIXEL(x) (bool)(x & 0x01) +#define ADNS9500_PASS_OBSERVATION_TEST(x) (bool)(x & ADNS9500_OBSERVATION_CHECK_BITS) #define ADNS9500_UINT16(ub, lb) (uint16_t)(((ub & 0xff) << 8) | (lb & 0xff)) #define ADNS9500_INT16(ub, lb) (int16_t)(((ub & 0xff) << 8) | (lb & 0xff))