This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ds_gyro_read(uint8_t* pBuffer, uint8_t ReadAddr, volatile uint16_t NumByteToRead) { | |
if (NumByteToRead > 0x01) { | |
ReadAddr |= (uint8_t)(0x80 | 0x40); // If sending more that one byte set multibyte commands | |
} | |
else { | |
ReadAddr |= (uint8_t) (0x80); // Else just set the read mode | |
} | |
GYRO_CS_LOW(); | |
//GPIO_ResetBits(GPIOE, GPIO_Pin_3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define free? | |
(lambda (y e ce) | |
(pmatch e | |
[,x (guard (symbol? x)) (and (eq? x y) (not (memq y ce)))] | |
[(lambda (,x) ,body) (free? y body (cons x ce))] | |
[(,rator ,rand) (or (free? y rator ce)(free? y rand ce))]))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define member? | |
(lambda (a lat) | |
(cond | |
((null? lat) #f) | |
(else (or (eq? (car lat) a) (member? a (cdr lat))))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; A lat is a list of atoms. | |
(define lat? | |
(lambda (l) | |
(cond | |
((null? l) #t) | |
((not (atom? (car l))) #f) | |
(else (lat? (cdr l)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define atom? | |
(lambda (x) | |
(and (not (pair? x)) (not (null? x))))) | |
;; Test code | |
(atom? (quote ())) |
NewerOlder