C51 COMPILER V9.54   ISP                                                                   04/27/2022 18:23:48 PAGE 1   


C51 COMPILER V9.54, COMPILATION OF MODULE ISP
OBJECT MODULE PLACED IN .\Objects\ISP.obj
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE source\ISP.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND PRINT(.\Listing
                    -s\ISP.lst) TABS(2) OBJECT(.\Objects\ISP.obj)

line level    source

   1          /******************** (C) COPYRIGHT 2022 SONiX *******************************
   2          * COMPANY:  SONiX
   3          * DATE:   2022/04/27
   4          * IC:     SN8F5835
   5          *____________________________________________________________________________
   6          * REVISION    Date        Author    Description
   7          * 1.0         2021/04/27  Eden      1. First release
   8          *____________________________________________________________________________
   9          *****************************************************************************/
  10          /*_____ I N C L U D E S _________________________________*/
  11          #include <SN8F5835.h>
  12          #include "ISP.h"
  13          /*_____ F U N C T I O N S _______________________________*/
  14          
  15          /*_____ D E F I N I T I O N S ___________________________*/
  16          
  17          /*_____ D E C L A R A T I O N S _________________________*/
  18          
  19          /*_____ M A C R O S _____________________________________*/
  20          
  21          /**
  22           *  @Brief    isp_page_write: ISP Page Write Function
  23           *  @param    None
  24           *  @retval   None
  25           */
  26          uint8_t ISP_WritePage_ChecksumVerify(uint8_t code* bRomAdress, uint8_t* bRamBufAddress)
  27          {
  28   1        uint8_t i;
  29   1        uint16_t  dbRamChecksum = 0;
  30   1        uint16_t  dbRomResult = 0;
  31   1        uint8_t code* ptrRom = (uint16_t*) ((uint16_t) bRomAdress & 0xFFC0);  
  32   1        
  33   1        /* Step1: Calculation RAM checksum  */
  34   1        for(i=0; i<32 ;i++)
  35   1        {
  36   2          dbRamChecksum += *(bRamBufAddress+i);
  37   2        }
  38   1        
  39   1        /* Step2: (1) Setting ISP RAM Address 
  40   1                  (2) Setting ISP ROM Address */
  41   1        PERAM =(uint8_t)  bRamBufAddress;
  42   1        PEROM =(uint16_t) bRomAdress;   
  43   1        PAGE_WRITE_START();
  44   1        
  45   1        /* Step3: Calculation ROM checksum  */  
  46   1        for(i=0; i<32 ;i++)
  47   1        {
  48   2          dbRomResult += *(ptrRom+i);
  49   2        } 
  50   1        
  51   1        /* Step4: Compare RAM/ROM Checksum and return compare result */
  52   1        if(dbRomResult == dbRamChecksum)
  53   1        {
  54   2          return 1; /*  ISP Success */
C51 COMPILER V9.54   ISP                                                                   04/27/2022 18:23:48 PAGE 2   

  55   2        }
  56   1        else
  57   1        {
  58   2          return 0; /* ISP Failed */
  59   2        }
  60   1      }
  61          
  62          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    118    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----      10
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)
