ŠTUDENTSKÝ VÝVOJOVÝ TÍM
or
How small ideas open the door to great possibilities
Kamila Součková
Join us! ;-)
presentation based on Adam Dej's work (http://slides.com/adamdej/svt-deadlock)
...and more!
+
// __attribute__((OS_main)) tells the compiler that this function never
// returns and saves us precious space
__attribute__((OS_main)) int main(void) {
hal_init(&comm_byte_received_callback);
// This is the main handling loop
// It handles all packets that can arrive in the Normal mode
while (1) {
if (comm_wait_for_packet(&p[current_packet]) == 0) {
switch (p[current_packet].id) {
case packet_GET_STATUS:
sendACK();
break;
case packet_RFID_SEND:
// We will send data from this packet, and replace them
// in-place with what we receive
hal_spi_begin_transaction();
for (uint8_t i = 0; i < p[current_packet].length; i++) {
p[current_packet].data[i] =
hal_spi_transfer(p[current_packet].data[i]);
}
hal_spi_end_transaction();
// And suddenly, we are a response packet :)
p[current_packet].id = packet_RFID_SEND_COMPLETE;
transmit_and_flip();
break;
case packet_RX_ERROR:
// Retransmit the last packet
comm_transmit_packet(&p[current_packet ^ 1]);
break;
default:
// Unacceptable packet was received in this mode
p[current_packet].id = packet_INVALID_PACKET;
p[current_packet].length = 0;
transmit_and_flip();
break;
=> needs to be done well!
Cheaper than the commercial alternatives... By an order of magnitude.
(~1e1 vs 1e2 €/door)
No vendor lock-in
Available parts / simple alternatives
Plug-and-play
Extensible deployment
HW can be easily replaced
Modular architecture
Ready for changes in ISIC cards
or
How small ideas open the door to great possibilities
svt.fmph.uniba.sk
fmfi-svt@googlegroups.com