Skip to content

Commit

Permalink
Revert "BitManipulation mock"
Browse files Browse the repository at this point in the history
This reverts commit 308b19f.
  • Loading branch information
annika committed Dec 2, 2019
1 parent 308b19f commit 53ff669
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 138 deletions.
17 changes: 0 additions & 17 deletions .clwb/.bazelproject

This file was deleted.

11 changes: 0 additions & 11 deletions .clwb/.blaze/modules/.project-data-dir.iml

This file was deleted.

16 changes: 0 additions & 16 deletions .clwb/.blaze/modules/.workspace.iml

This file was deleted.

1 change: 0 additions & 1 deletion .clwb/.idea/.name

This file was deleted.

6 changes: 0 additions & 6 deletions .clwb/.idea/externalDependencies.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .clwb/.idea/modules.xml

This file was deleted.

24 changes: 0 additions & 24 deletions .clwb/.idea/runConfigurations.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .clwb/.idea/vcs.xml

This file was deleted.

19 changes: 0 additions & 19 deletions .clwb/.idea/workspace.xml

This file was deleted.

15 changes: 1 addition & 14 deletions EmbeddedUtilities/BitManipulation.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef COMMUNICATIONMODULE_BITMANIPULATION_H
#define COMMUNICATIONMODULE_BITMANIPULATION_H

#ifdef TEST
#include "EmbeddedUtilities/BitManipulation_Test.h"
#else
#include <stdint.h>
#include <stdbool.h>

Expand Down Expand Up @@ -150,15 +147,7 @@ BitManipulation_get16BitFromBigEndianByteArray(volatile const uint8_t *array) {

static inline void BitManipulation_clearBit(volatile uint8_t *byte_ptr, uint8_t offset) {
*(byte_ptr) &= ~(1 << offset);
}byte_index = (uint8_t) (offset / 8);
uint8_t local_offset = (uint8_t) (offset % 8);
uint8_t lower_bitmask = bitmask << local_offset;
uint8_t upper_bitmask = bitmask >> (8 - local_offset);
uint8_t value = (field[byte_index] & lower_bitmask) >> local_offset;
if (upper_bitmask != 0) {
value |= (field[byte_index + 1] & upper_bitmask) << (8 - local_offset);
}
return value;
}

static inline void BitManipulation_setBit(volatile uint8_t *byte_ptr, uint8_t offset) {
*(byte_ptr) |= (1 << offset);
Expand Down Expand Up @@ -201,6 +190,4 @@ BitManipulation_getLengthOfContinuousSetBitsFromByte(uint8_t byte)
}
return length;
}

#endif
#endif //COMMUNICATIONMODULE_BITMANIPULATION_H
14 changes: 0 additions & 14 deletions EmbeddedUtilities/BitManipulation_Test.h

This file was deleted.

2 changes: 1 addition & 1 deletion test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ unity_test(
deps = [
"//:BitManipulation",
"@CException"
],
]
)

0 comments on commit 53ff669

Please sign in to comment.