Compare commits
2 Commits
56e9a87b25
...
master
Author | SHA1 | Date | |
---|---|---|---|
05fe5d53f4 | |||
56705b840b |
@@ -27,6 +27,9 @@
|
|||||||
#define RESET_DDR DDRB
|
#define RESET_DDR DDRB
|
||||||
#define RESET_PORT PORTB
|
#define RESET_PORT PORTB
|
||||||
#define RESET PB0
|
#define RESET PB0
|
||||||
|
#define WAKE_PORT PORTB
|
||||||
|
#define WAKE_DDR DDRB
|
||||||
|
#define WAKE_PIN PB1
|
||||||
#define INTERRUPT ISR(INT2_vect)
|
#define INTERRUPT ISR(INT2_vect)
|
||||||
#elif defined RASPBERRYPI
|
#elif defined RASPBERRYPI
|
||||||
|
|
||||||
|
@@ -104,12 +104,17 @@ word Mrf24j::address16_read(void) {
|
|||||||
return a16h << 8 | read_short(MRF_SADRL);
|
return a16h << 8 | read_short(MRF_SADRL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Mrf24j::send_str(word dest16, char * data) {
|
||||||
|
byte len = strlen(data); // get the length of the char* array
|
||||||
|
send(dest16, data, len);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple send 16, with acks, not much of anything.. assumes src16 and local pan only.
|
* Simple send 16, with acks, not much of anything.. assumes src16 and local pan only.
|
||||||
* @param data
|
* @param data
|
||||||
*/
|
*/
|
||||||
void Mrf24j::send16(word dest16, char * data) {
|
void Mrf24j::send(word dest16, char * data, int len) {
|
||||||
byte len = strlen(data); // get the length of the char* array
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
write_long(i++, bytes_MHR); // header length
|
write_long(i++, bytes_MHR); // header length
|
||||||
// +ignoreBytes is because some module seems to ignore 2 bytes after the header?!.
|
// +ignoreBytes is because some module seems to ignore 2 bytes after the header?!.
|
||||||
|
@@ -227,7 +227,8 @@ class Mrf24j
|
|||||||
*/
|
*/
|
||||||
void set_palna(boolean enabled);
|
void set_palna(boolean enabled);
|
||||||
|
|
||||||
void send16(word dest16, char * data);
|
void send(word dest16, char * data, int len);
|
||||||
|
void send_str(word dest16, char * data);
|
||||||
|
|
||||||
void interrupt_handler(void);
|
void interrupt_handler(void);
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ int main() {
|
|||||||
//mrf.wake();
|
//mrf.wake();
|
||||||
|
|
||||||
sprintf(tmp,"Received %i\n\r", i);
|
sprintf(tmp,"Received %i\n\r", i);
|
||||||
mrf.send16(0x4202, tmp);
|
mrf.send_str(0x4202, tmp);
|
||||||
|
|
||||||
_delay_ms(2000);
|
_delay_ms(2000);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user