Merge pull request #18 from willcode/master
Fix param names, shift overflow, suppress unused var warnings
This commit is contained in:
@ -119,6 +119,7 @@ void max2837_setup(void)
|
||||
uint16_t max2837_spi_read(uint8_t r) {
|
||||
gpio_clear(PORT_XCVR_CS, PIN_XCVR_CS);
|
||||
// FIXME: Unimplemented.
|
||||
r=r;
|
||||
gpio_set(PORT_XCVR_CS, PIN_XCVR_CS);
|
||||
return 0;
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ void rffc5071_spi_write(uint8_t r, uint16_t v) {
|
||||
|
||||
int bits = 25;
|
||||
int msb = 1 << (bits -1);
|
||||
uint32_t data = ((reg & 0x7f) << 16) | val;
|
||||
uint32_t data = ((r & 0x7f) << 16) | v;
|
||||
|
||||
/* make sure everything is starting in the correct state */
|
||||
gpio_set(PORT_MIXER, PIN_MIXER_ENX);
|
||||
@ -458,6 +458,9 @@ uint16_t rffc5071_config_synth_int(uint16_t lo) {
|
||||
uint16_t rffc5071_set_frequency(uint16_t mhz, uint32_t hz) {
|
||||
uint16_t tune_freq;
|
||||
|
||||
// Fractional tuning unimplemented, 'hz' ignored
|
||||
hz=hz;
|
||||
|
||||
rffc5071_disable();
|
||||
tune_freq = rffc5071_config_synth_int(mhz);
|
||||
rffc5071_enable();
|
||||
|
@ -39,11 +39,11 @@
|
||||
* l=length (bits) */
|
||||
#define __MREG__(n,r,o,l) \
|
||||
static inline uint16_t get_##n(void) { \
|
||||
return (rffc5071_regs[r] >> o) & ((1<<l)-1); \
|
||||
return (rffc5071_regs[r] >> o) & ((1L<<l)-1); \
|
||||
} \
|
||||
static inline void set_##n(uint16_t v) { \
|
||||
rffc5071_regs[r] &= ~(((1<<l)-1)<<o); \
|
||||
rffc5071_regs[r] |= ((v&((1<<l)-1))<<o); \
|
||||
rffc5071_regs[r] &= (uint16_t)(~(((1L<<l)-1)<<o)); \
|
||||
rffc5071_regs[r] |= (uint16_t)(((v&((1L<<l)-1))<<o)); \
|
||||
RFFC5071_REG_SET_DIRTY(r); \
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user