SENtral Simple Serial Host interface for PNI Sensor Corp SENtral-A2 motion coprocessor. For use with the RM3100RTI Arduino shield module on top of an STM4 serial mbed board. Will work with an PNI RM3100RTI module or M&M motion modules. Interaction with unit using built in USB serial serial port set for 115200 baud. Send '?' char for menu. Presently requires SENtral firmware to either be loaded in the RM3100RTI Arduino shield SD Card or preloaded in the RM3100RTI or M&M module's EEPROM. Firmware is typically preloaded on the module's EEPROM by PNI. PNI Sensor, 2019 www.pnicorp.com
Dependencies: mbed SDFileSystemVSG
SENtral Simple Serial Host interface for PNI Sensor Corp SENtral-A2 motion coprocessor. For use with the RM3100RTI Arduino shield module on top of an STM4 serial mbed board. Will work with an PNI RM3100RTI module or M&M motion modules. Interaction with unit using built in USB serial serial port set for 115200 baud. Send '?' char for menu. Presently requires SENtral firmware to either be loaded in the RM3100RTI Arduino shield SD Card or preloaded in the RM3100RTI or M&M module's EEPROM. Firmware is typically preloaded on the module's EEPROM by PNI. PNI Sensor, 2019 www.pnicorp.com
Revision 3:69239f60d620, committed 2016-10-10
- Comitter:
- JoeMiller
- Date:
- Mon Oct 10 21:10:44 2016 +0000
- Parent:
- 2:9d8bb6331813
- Child:
- 4:cc298d6a7dcc
- Commit message:
- 1) Fixed interrupt issue; 2) Added Sensor ID number to sensor information request, command 'n'.
Changed in this revision
em7186.cpp | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 9d8bb6331813 -r 69239f60d620 em7186.cpp --- a/em7186.cpp Fri Jul 22 18:13:42 2016 +0000 +++ b/em7186.cpp Mon Oct 10 21:10:44 2016 +0000 @@ -1451,17 +1451,18 @@ void displaySensorInformation() { if (!haveSensorInfo) { getSensorInformation(); }; - printf("+------------------------------------------------------------------------------------+\n\r"); - printf("| Sensor Information |\n\r"); - printf("+----------------------------------+---------+-------+-------+-----+----------+------+\n\r"); - printf("| Sensor | Driver | Power | Range | Res | Rate | Size |\n\r"); - printf("+----------------------------------+---------+-------+-------+-----+----------+------+\n\r"); + printf("+------------------------------------------------------------------------------------------+\n\r"); + printf("| Sensor Information |\n\r"); + printf("+----------------------------------------+---------+-------+-------+-----+----------+------+\n\r"); + printf("| ID |Sensor | Driver | Power | Range | Res | Rate | Size |\n\r"); + printf("+-----|----------------------------------+---------+-------+-------+-----+----------+------+\n\r"); u8 i; for (i = 0; i < sizeof(sensorInfoParamList) / sizeof(sensorInfoParamList[0]); i++) { if (sensorInformation[i].sensorId > 0) { - printf("| %-32s | % 3u.%-3u | % 4u | % 5u | % 3u | %-3u-% 4u | % 3u |\n\r", + printf("|%3u | %-32s | % 3u.%-3u | % 4u | % 5u | % 3u | %-3u-% 4u | % 3u |\n\r", + i, em7186_sensor_name[sensorInformation[i].sensorId], sensorInformation[i].driverId, sensorInformation[i].driverVersion, sensorInformation[i].power, sensorInformation[i].maxRange, sensorInformation[i].resolution, @@ -1469,7 +1470,7 @@ sensorInformation[i].eventSize); } } - printf("+----------------------------------+---------+-------+-------+-----+----------+------+\n\r"); + printf("+-----|----------------------------------+---------+-------+-------+-----+----------+------+\n\r"); }
diff -r 9d8bb6331813 -r 69239f60d620 main.cpp --- a/main.cpp Fri Jul 22 18:13:42 2016 +0000 +++ b/main.cpp Mon Oct 10 21:10:44 2016 +0000 @@ -33,6 +33,7 @@ u8 fw[] = { "/sd/sentral.fw" }; u8 logfilename[] = { "/sd/log.csv" }; //u8 warmStartFile[] = { "/sd/warmstart.dat" }; +u8 sentral_service_flag=0; FILE *flog; @@ -45,9 +46,9 @@ void SENtral_Interrupt(void) { - bytesRead = em7186_read_fifo(fifoBuffer); - em7186_parse_fifo(fifoBuffer, bytesRead); - + sentral_service_flag=1; + SENtral_InterruptPin.disable_irq(); + } void OnSerial(void) @@ -384,6 +385,15 @@ processSerialInchar(serial_inchar); // process user key commands serial_inchar = NULL; } + + if (sentral_service_flag) + { + sentral_service_flag=0; + bytesRead = em7186_read_fifo(fifoBuffer); + em7186_parse_fifo(fifoBuffer, bytesRead); + SENtral_InterruptPin.enable_irq(); + + } if (pushButton == 1) // PBSwitch is wired as active high runScript(); // execute special script(function)