Skip to content

Commit 7ad3ca2

Browse files
committed
fix: servo positions
1 parent cf254f5 commit 7ad3ca2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Arduino_Alvik.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,9 +989,9 @@ void Arduino_Alvik::set_illuminator(const bool value){
989989
}
990990

991991
void Arduino_Alvik::set_servo_positions(const uint8_t a_position, const uint8_t b_position){
992+
while (!xSemaphoreTakeRecursive(buffer_semaphore, TICK_TIME_SEMAPHORE));
992993
servo_positions[0] = a_position;
993994
servo_positions[1] = b_position;
994-
while (!xSemaphoreTakeRecursive(buffer_semaphore, TICK_TIME_SEMAPHORE));
995995
msg_size = packeter->packetC2B('S', a_position, b_position);
996996
uart->write(packeter->msg, msg_size);
997997
xSemaphoreGiveRecursive(buffer_semaphore);

0 commit comments

Comments
 (0)