#include<unistd.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<stdio.h>
#include<fcntl.h>
#include<assert.h>

int main(void)
{

	volatile unsigned char *wdt_control;
	volatile unsigned char *wdt_feed;

	
	int fd = open("/dev/mem", O_RDWR|O_SYNC);
	assert(fd != -1);
	
	wdt_control = (unsigned char *)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x23800000);
	wdt_feed = (unsigned char *)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x23C00000);

	
	//printf("%d\n",*wdt_control);
	
	*wdt_feed=0x05;
	*wdt_control=0x07;
	
   //printf("%d\n",*wdt_control);
   
    while(1)
    {
    	*wdt_feed=0x05;
    	sleep(5);
    
    
    
    }
             
   
   
   
   

}
