aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32F37x/I2C/main.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-29 07:25:11 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-29 07:25:11 +0000
commit80d4ec8d07aa1945a173acdb18933a4719937509 (patch)
treec588ed3d02bd66610eda25308b07569e0ef45065 /testhal/STM32F37x/I2C/main.c
parent81f5ffb330ab4670bec7e79d6e0009378efa81c4 (diff)
downloadChibiOS-80d4ec8d07aa1945a173acdb18933a4719937509.tar.gz
ChibiOS-80d4ec8d07aa1945a173acdb18933a4719937509.tar.bz2
ChibiOS-80d4ec8d07aa1945a173acdb18933a4719937509.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6328 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32F37x/I2C/main.c')
-rw-r--r--testhal/STM32F37x/I2C/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/testhal/STM32F37x/I2C/main.c b/testhal/STM32F37x/I2C/main.c
index fc0e4e2ab..cd1ac7417 100644
--- a/testhal/STM32F37x/I2C/main.c
+++ b/testhal/STM32F37x/I2C/main.c
@@ -44,10 +44,11 @@ static const I2CConfig i2cconfig = {
* This is a periodic thread that does absolutely nothing except flashing
* a LED.
*/
-static WORKING_AREA(blinker_wa, 128);
-static msg_t blinker(void *arg) {
+static THD_WORKING_AREA(blinker_wa, 128);
+static THD_FUNCTION(blinker, arg) {
(void)arg;
+
chRegSetThreadName("blinker");
while (TRUE) {
palSetPad(GPIOC, GPIOC_LED1);
@@ -95,12 +96,12 @@ int main(void) {
msg = i2cMasterTransmitTimeout(&I2CD2, 0x52, cmd, sizeof(cmd),
data, sizeof(data), TIME_INFINITE);
- if (msg != RDY_OK)
+ if (msg != MSG_OK)
palTogglePad(GPIOC, GPIOC_LED3);
for (i = 0; i < 256; i++) {
msg = i2cMasterReceiveTimeout(&I2CD2, 0x52,
data, sizeof(data), TIME_INFINITE);
- if (msg != RDY_OK)
+ if (msg != MSG_OK)
palTogglePad(GPIOC, GPIOC_LED3);
}
chThdSleepMilliseconds(500);