Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: pixy2.cpp
- Revision:
- 26:a56cc5d715e9
- Parent:
- 25:2a2fcb9e4775
- Child:
- 27:bee63ac9b70b
--- a/pixy2.cpp Thu Nov 21 09:31:05 2019 +0000 +++ b/pixy2.cpp Thu Nov 28 07:39:32 2019 +0000 @@ -646,20 +646,11 @@ do { lineFeature = (T_pixy2LineFeature*) &Pixy2_buffer[fPointer]; // On mappe le pointeur de structure sur le buffer de réception des features. if (lineFeature->fType == PIXY2_VECTOR) { // On regarde si le type est vecteur - Pixy2_numVectors = lineFeature->fLength / sizeof(T_pixy2Vector); - // Si oui, on compte combien il y a de vecteurs - Pixy2_vectors = (T_pixy2Vector*) &Pixy2_buffer[fPointer]; // On mappe le résultat + Pixy2_numVectors = lineFeature->fLength / sizeof(T_pixy2Vector); // Si oui, on compte combien il y a de vecteurs + Pixy2_vectors = (T_pixy2Vector*) &Pixy2_buffer[fPointer + 2]; // On mappe le résultat fPointer += lineFeature->fLength; // On déplace le pointeur de données et on recommence cr |= PIXY2_VECTOR; } - - if (lineFeature->fType == PIXY2_BARCODE) { // On regarde si le type est codebarre - Pixy2_numBarcodes = lineFeature->fLength / sizeof(T_pixy2BarCode); - // Si oui, on compte combien il y a de codebarre - Pixy2_barcodes = (T_pixy2BarCode*) &Pixy2_buffer[fPointer]; // On mappe le résultat - fPointer += lineFeature->fLength; // On déplace le pointeur de données et on recommence - cr |= PIXY2_BARCODE; - } if (lineFeature->fType == PIXY2_INTERSECTION) { // On regarde si le type est intersection Pixy2_numIntersections = lineFeature->fLength / sizeof(T_pixy2Intersection); // Si oui, on compte combien il y a d'intersections @@ -668,6 +659,13 @@ fPointer += lineFeature->fLength; // On déplace le pointeur de données et on recommence cr |= PIXY2_INTERSECTION; } + if (lineFeature->fType == PIXY2_BARCODE) { // On regarde si le type est codebarre + Pixy2_numBarcodes = lineFeature->fLength / sizeof(T_pixy2BarCode); + // Si oui, on compte combien il y a de codebarre + Pixy2_barcodes = (T_pixy2BarCode*) &Pixy2_buffer[fPointer]; // On mappe le résultat + fPointer += lineFeature->fLength; // On déplace le pointeur de données et on recommence + cr |= PIXY2_BARCODE; + } } while(fPointer < ((dataSize - 1) + dPointer)); // Tant qu'il y a des données à traiter } else { // Si ce n'est pas le bon type if (msg->pixType == PIXY2_REP_ERROR) { // Cela pourrait être une trame d'erreur