Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
#if BOOTLOADER_CAN_EXIT
static uchar requestBootLoaderExit;
#endif
#if BOOTLOADER_CAN_EXIT
static uchar requestBootLoaderExit;
#endif
-static volatile unsigned char stayinloader = 1;
+static volatile unsigned char stayinloader = 0xfe;
static longConverter_t currentAddress; /* in bytes */
static uchar bytesRemaining;
static longConverter_t currentAddress; /* in bytes */
static uchar bytesRemaining;
}
}else if(rq->bRequest == USBASP_FUNC_DISCONNECT){
}
}else if(rq->bRequest == USBASP_FUNC_DISCONNECT){
- stayinloader &= (0x7f);
+ stayinloader &= (0xfe);
#if BOOTLOADER_CAN_EXIT
requestBootLoaderExit = 1; /* allow proper shutdown/close of connection */
#endif
}else if(rq->bRequest == USBASP_FUNC_CONNECT){
#if BOOTLOADER_CAN_EXIT
requestBootLoaderExit = 1; /* allow proper shutdown/close of connection */
#endif
}else if(rq->bRequest == USBASP_FUNC_CONNECT){
- stayinloader |= (0x80);
+ stayinloader |= (0x01);
}else{
/* ignore: others */
}
}else{
/* ignore: others */
}
- if (stayinloader & 0x1) {
+ if (stayinloader > 0x04) {
if (!bootLoaderCondition()) {
if (!bootLoaderCondition()) {
- stayinloader = (stayinloader & 0xfc) | 0x2;
}
} else {
if (bootLoaderCondition()) {
}
} else {
if (bootLoaderCondition()) {