File: C:\M91449\Perso\RTWdsPIC\Developpements\Forum\resodad_john\myFolder\SDtroubleshooting\SD_Datalogger5_dspic\sources\SD_Datalogger5_main.c1 /* 2 * File: SD_Datalogger5_main.c 3 * 4 * Real-Time Workshop code generated for Simulink model SD_Datalogger5. 5 * 6 * Model version : 1.22 7 * Real-Time Workshop file version : 8.0 (R2011a) 09-Mar-2011 8 * Real-Time Workshop file generated on : Tue Jan 17 11:54:59 2012 9 * TLC version : 8.0 (Feb 3 2011) 10 * C source code generated on : Tue Jan 17 11:54:59 2012 11 *-------------------------------------------------------------- 12 * Embedded Coder for Microchip dsPIC family. | 13 * Generate .c and .h files from your Matlab/simulink model | 14 * and compile the diagram to .hex and .coff file that can be | 15 * downloaded directly into the microcontroller | 16 * | 17 * Licence Accorded to && Licence Name &&| 18 * && Companie &&| 19 * | 20 * Written by Lubin KERHUEL - http://www.kerhuel.eu | 21 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 22 * Version &&Version&& && Date &&| 23 * For Matlab && VerMatlab && && Release && | 24 *-------------------------------------------------------------- 25 */ 26 27 #include "SD_Datalogger5.h" 28 #include "SD_Datalogger5_private.h" 29 30 #pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_2, FWDTEN = OFF 31 #pragma config POSCMOD = XT, FNOSC = PRIPLL, FPBDIV = DIV_1 32 33 void rt_OneStep() 34 { 35 /* Disable interrupts here */ 36 37 /* Save FPU context here (if necessary) */ 38 /* Re-enable timer or interrupt here */ 39 SD_Datalogger5_step(); 40 41 /* Get model outputs here */ 42 43 /* Disable interrupts here */ 44 /* Restore FPU context here (if necessary) */ 45 /* Enable interrupts here */ 46 } 47 48 int main(void) 49 { 50 /* Initialize model */ 51 SD_Datalogger5_initialize(1); 52 for (;;) { 53 /* Associate rt_OneStep() with a timer that executes at the base rate of the model */ 54 while (!_T1IF) ; 55 _T1IF = 0; 56 rt_OneStep(); 57 } 58 } 59 60 /* File trailer for Real-Time Workshop generated code. 61 * 62 * [EOF] 63 */ 64 |