Skip to content

Commit 5faf8e1

Browse files
committed
исправлена ошибка в методе getStatus
1 parent 47cf91c commit 5faf8e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AMS_AS5600.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
** GitHub - https://github.com/S-LABc
1515
** Gmail - romansklyar15@gmail.com
1616
*
17-
* Copyright (C) 2022. v1.8 / License MIT / Скляр Роман S-LAB
17+
* Copyright (C) 2022. v1.9 / License MIT / Скляр Роман S-LAB
1818
*/
1919

2020
#include "AMS_AS5600.h"
@@ -1261,7 +1261,7 @@ word AS5600::getScaledAngle(void) {
12611261
*/
12621262
AS5600StatusReports AS5600::getStatus(void) {
12631263
AS_SendFirstRegister(AS5600_STATUS_REG);
1264-
return (AS5600StatusReports)AS_RequestSingleRegister();
1264+
return (AS5600StatusReports)((AS_RequestSingleRegister() >> AS5600_STATUS_BIT_MH_3) & 0x07); // 0x07 = 0b00000111
12651265
}
12661266
/*
12671267
* @brief: определить наличие магнита. регистр STATUS (MD:5)

0 commit comments

Comments
 (0)