mirror of
https://github.com/RfidResearchGroup/ChameleonMini.git
synced 2026-05-12 11:20:37 -07:00
Shared a function I forgot about, documented sharing practises
This commit is contained in:
@@ -116,6 +116,7 @@ typedef enum {
|
||||
extern uint8_t CodecBuffer[CODEC_BUFFER_SIZE];
|
||||
extern uint8_t CodecBuffer2[CODEC_BUFFER_SIZE];
|
||||
|
||||
/* Shared ISR pointers and handlers */
|
||||
void (* volatile isr_func_TCD0_CCC_vect)(void);
|
||||
void isr_Reader14443_2A_TCD0_CCC_vect(void);
|
||||
void isr_ISO15693_CODEC_TIMER_SAMPLING_CCC_VECT(void);
|
||||
|
||||
@@ -258,7 +258,7 @@ ISR_SHARED isr_ISO15693_CODEC_TIMER_SAMPLING_CCC_VECT(void) {
|
||||
* It disables its own interrupt when all data has been sent
|
||||
*/
|
||||
//ISR(CODEC_TIMER_LOADMOD_CCB_VECT)
|
||||
void isr_ISO15693_CODEC_TIMER_LOADMOD_CCB_VECT(void) {
|
||||
ISR_SHARED isr_ISO15693_CODEC_TIMER_LOADMOD_CCB_VECT(void) {
|
||||
static void *JumpTable[] = {
|
||||
[LOADMOD_START_SINGLE] = && LOADMOD_START_SINGLE_LABEL,
|
||||
[LOADMOD_SOF_SINGLE] = && LOADMOD_SOF_SINGLE_LABEL,
|
||||
|
||||
@@ -351,16 +351,13 @@ ISR(ACA_AC0_vect) { // this interrupt either finds the SOC or gets triggered bef
|
||||
StateRegister = PICC_FRAME;
|
||||
}
|
||||
|
||||
ISR(CODEC_TIMER_LOADMOD_CCB_VECT) { // pause found
|
||||
isr_func_CODEC_TIMER_LOADMOD_CCB_VECT();
|
||||
}
|
||||
|
||||
// Called once a pause is found
|
||||
// Decode the Card -> Reader signal
|
||||
// according to the pause and modulated period
|
||||
// if the half bit duration is modulated, then add 1 to buffer
|
||||
// if the half bit duration is not modulated, then add 0 to buffer
|
||||
//ISR(CODEC_TIMER_LOADMOD_CCB_VECT) // pause found
|
||||
void isr_SniffISO14443_2A_CODEC_TIMER_LOADMOD_CCB_VECT(void) {
|
||||
ISR_SHARED isr_SniffISO14443_2A_CODEC_TIMER_LOADMOD_CCB_VECT(void) {
|
||||
uint8_t tmp = CODEC_TIMER_TIMESTAMPS.CNTL;
|
||||
CODEC_TIMER_TIMESTAMPS.CNT = 0;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "Codec/Codec.h"
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
; Use this macro to call isr functions
|
||||
; Macro to call ISR functions
|
||||
.macro call_isr isr_address
|
||||
push r30
|
||||
push r31
|
||||
@@ -21,7 +21,23 @@ pop r30
|
||||
reti
|
||||
.endm
|
||||
|
||||
; Find first pause and start sampling
|
||||
; Shared ISR must be defined below as globals
|
||||
; Example:
|
||||
;
|
||||
; .global <INTERRUPT-TO-SHARE>
|
||||
; INTERRUPT-TO-SHARE:
|
||||
; call_isr POINTER-TO-VARIABLE-INTERRUPT-HANDLER
|
||||
;
|
||||
; Where:
|
||||
; INTERRUPT-TO-SHARE
|
||||
; The target interrupt which needs to be shared
|
||||
; POINTER-TO-VARIABLE-INTERRUPT-HANDLER
|
||||
; A pointer to the current interrupt handler which can be modified
|
||||
; at runtime. Must be a volatile pointer to function defined in Codec.h
|
||||
|
||||
; TODO spostare i commenti qui sotto alle funzioni appropriate. Non ha senso commentare i nomi dei vettori, ma bisogna commentare la funzione nel contesto
|
||||
; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
; Sample reader field and demodulate signal after first pause
|
||||
.global CODEC_DEMOD_IN_INT0_VECT
|
||||
CODEC_DEMOD_IN_INT0_VECT:
|
||||
call_isr isr_func_CODEC_DEMOD_IN_INT0_VECT
|
||||
@@ -30,3 +46,8 @@ CODEC_DEMOD_IN_INT0_VECT:
|
||||
.global CODEC_TIMER_SAMPLING_CCC_VECT
|
||||
CODEC_TIMER_SAMPLING_CCC_VECT:
|
||||
call_isr isr_func_TCD0_CCC_vect
|
||||
|
||||
; Send response data from emulated card to reader
|
||||
.global CODEC_TIMER_LOADMOD_CCB_VECT
|
||||
CODEC_TIMER_LOADMOD_CCB_VECT:
|
||||
call_isr isr_func_CODEC_TIMER_LOADMOD_CCB_VECT
|
||||
Reference in New Issue
Block a user