Skip to content

Commit

Permalink
Merge fixes for GCC 10
Browse files Browse the repository at this point in the history
  • Loading branch information
ceres-c committed Aug 28, 2020
2 parents 86be22d + c82572d commit 8494044
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 19 deletions.
3 changes: 0 additions & 3 deletions Firmware/Chameleon-Mini/Application/EM4233.c
Expand Up @@ -23,9 +23,6 @@ static enum {
} State;

bool loggedIn;
uint8_t MyAFI; /* This variable holds current tag's AFI (is used in inventory) */

CurrentFrame FrameInfo;

void EM4233AppInit(void) {
State = STATE_READY;
Expand Down
3 changes: 3 additions & 0 deletions Firmware/Chameleon-Mini/Application/ISO15693-A.c
Expand Up @@ -2,6 +2,9 @@
#include "../Common.h"
#include <util/crc16.h>

CurrentFrame FrameInfo;
uint8_t MyAFI;

//Refer to ISO/IEC 15693-3:2001 page 41
uint16_t calculateCRC(void *FrameBuf, uint16_t FrameBufSize) {
uint16_t reg = ISO15693_CRC16_PRESET;
Expand Down
2 changes: 2 additions & 0 deletions Firmware/Chameleon-Mini/Application/ISO15693-A.h
Expand Up @@ -85,6 +85,8 @@ typedef struct {
bool Addressed;
bool Selected;
} CurrentFrame;
extern CurrentFrame FrameInfo; /* Holds current frame information */
extern uint8_t MyAFI; /* Holds current tag's AFI (is used in inventory) */

void ISO15693AppendCRC(uint8_t *FrameBuf, uint16_t FrameBufSize);
bool ISO15693CheckCRC(void *FrameBuf, uint16_t FrameBufSize);
Expand Down
3 changes: 3 additions & 0 deletions Firmware/Chameleon-Mini/Application/Reader14443A.c
Expand Up @@ -19,6 +19,9 @@

// TODO replace remaining magic numbers

uint8_t ReaderSendBuffer[CODEC_BUFFER_SIZE];
uint16_t ReaderSendBitCount;

static bool Selected = false;
Reader14443Command Reader14443CurrentCommand = Reader14443_Do_Nothing;

Expand Down
4 changes: 2 additions & 2 deletions Firmware/Chameleon-Mini/Application/Reader14443A.h
Expand Up @@ -6,8 +6,8 @@

#define CRC_INIT 0x6363

uint8_t ReaderSendBuffer[CODEC_BUFFER_SIZE];
uint16_t ReaderSendBitCount;
extern uint8_t ReaderSendBuffer[];
extern uint16_t ReaderSendBitCount;

void Reader14443AAppInit(void);
void Reader14443AAppReset(void);
Expand Down
2 changes: 0 additions & 2 deletions Firmware/Chameleon-Mini/Application/TITagitstandard.c
Expand Up @@ -16,10 +16,8 @@ static enum {
STATE_QUIET
} State;

uint8_t MyAFI; /* Holds current tag's AFI (is used in inventory) */
uint16_t UserLockBits_Mask = 0; /* Holds lock state of blocks */
uint16_t FactoryLockBits_Mask = 0; /* Holds lock state of blocks */
CurrentFrame FrameInfo;

void TITagitstandardAppInit(void) {
State = STATE_READY;
Expand Down
5 changes: 5 additions & 0 deletions Firmware/Chameleon-Mini/Codec/Codec.c
Expand Up @@ -24,6 +24,11 @@ static volatile struct {

uint8_t CodecBuffer[CODEC_BUFFER_SIZE];
uint8_t CodecBuffer2[CODEC_BUFFER_SIZE];

void (* volatile isr_func_CODEC_TIMER_LOADMOD_CCB_VECT)(void) = NULL;
void (* volatile isr_func_TCD0_CCC_vect)(void) = NULL;
void (* volatile isr_func_CODEC_DEMOD_IN_INT0_VECT)(void) = NULL;

// the following three functions prevent sending data directly after turning on the reader field
void CodecReaderFieldStart(void) { // DO NOT CALL THIS FUNCTION INSIDE APPLICATION!
if (!CodecGetReaderField() && !ReaderFieldFlags.ToBeRestarted) {
Expand Down
6 changes: 3 additions & 3 deletions Firmware/Chameleon-Mini/Codec/Codec.h
Expand Up @@ -117,13 +117,13 @@ 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);
extern 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);
void (* volatile isr_func_CODEC_DEMOD_IN_INT0_VECT)(void);
extern void (* volatile isr_func_CODEC_DEMOD_IN_INT0_VECT)(void);
void isr_ISO14443_2A_TCD0_CCC_vect(void);
void isr_ISO15693_CODEC_DEMOD_IN_INT0_VECT(void);
void (* volatile isr_func_CODEC_TIMER_LOADMOD_CCB_VECT)(void);
extern void (* volatile isr_func_CODEC_TIMER_LOADMOD_CCB_VECT)(void);
void isr_ISO15693_CODEC_TIMER_LOADMOD_CCB_VECT(void);
void isr_SniffISO14443_2A_CODEC_TIMER_LOADMOD_CCB_VECT(void);

Expand Down
1 change: 0 additions & 1 deletion Firmware/Chameleon-Mini/Codec/ISO15693.c
Expand Up @@ -88,7 +88,6 @@ static volatile uint16_t ReadCommandFromReader = 0;
* CODEC_DEMOD_IN_PORT.INT0MASK = CODEC_DEMOD_IN_MASK0;
* and unregistered writing the INT0MASK to 0
*/
// ISR(CODEC_DEMOD_IN_INT0_VECT)
ISR_SHARED isr_ISO15693_CODEC_DEMOD_IN_INT0_VECT(void) {
/* Start sample timer CODEC_TIMER_SAMPLING (TCD0).
* Set Counter Channel C (CCC) with relevant bitmask (TC0_CCCIF_bm),
Expand Down
2 changes: 2 additions & 0 deletions Firmware/Chameleon-Mini/Codec/SniffISO14443-2A.c
Expand Up @@ -56,6 +56,8 @@ static volatile uint16_t ReaderBitCount;
static volatile uint16_t CardBitCount;
static volatile uint16_t rawBitCount;

enum RCTraffic TrafficSource;

INLINE void CardSniffInit(void);
INLINE void CardSniffDeinit(void);

Expand Down
2 changes: 1 addition & 1 deletion Firmware/Chameleon-Mini/Codec/SniffISO14443-2A.h
Expand Up @@ -9,7 +9,7 @@
#include "Codec.h"
#include "Terminal/CommandLine.h"

enum RCTraffic {TRAFFIC_READER, TRAFFIC_CARD} TrafficSource;
extern enum RCTraffic {TRAFFIC_READER, TRAFFIC_CARD} TrafficSource;
/* Codec Interface */
void Sniff14443ACodecInit(void);
void Sniff14443ACodecDeInit(void);
Expand Down
9 changes: 2 additions & 7 deletions Firmware/Chameleon-Mini/ISRSharing.S
Expand Up @@ -32,22 +32,17 @@ reti
; 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
; A pointer to the interrupt handler which can be modified at runtime.
; Must be a volatile pointer to function declared 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

; Frame Delay Time PCD to PICC ends
.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
1 change: 1 addition & 0 deletions Firmware/Chameleon-Mini/Terminal/Commands.c
Expand Up @@ -15,6 +15,7 @@
#include "../AntennaLevel.h"
#include "../Battery.h"
#include "../Codec/Codec.h"
#include "../Application/Reader14443A.h"

extern Reader14443Command Reader14443CurrentCommand;
extern Sniff14443Command Sniff14443CurrentCommand;
Expand Down

0 comments on commit 8494044

Please sign in to comment.